[Rd] xftrm is more than 100x slower for AsIs than for character vectors

2024-07-12 Thread Hilmar Berger via R-devel
Good evening, I recently have observed slow merges when combining multiple data frames derived from DataFrame and base::data.frame. I observed that the index column of intermediate tables was of class (automatically converted from character). The problem occurred mainly when using the sorted = T

Re: [Rd] xftrm is more than 100x slower for AsIs than for character vectors

2024-07-14 Thread Ivan Krylov via R-devel
В Fri, 12 Jul 2024 17:35:19 +0200 Hilmar Berger via R-devel пишет: > This can be finally traced to base::rank() (called from > xtfrm.default), where I found that > > "NB: rank is not itself generic but xtfrm is, and rank(xtfrm(x), ) > will have the desired result if there is a xtfrm method.

Re: [Rd] xftrm is more than 100x slower for AsIs than for character vectors

2024-07-14 Thread HB via R-devel
Dear Ivan, thanks for the confirmation and the proposed patch. I just wanted to add some notes regarding the relevance of this: base::merge using by.x=0 or by.y=0 (i.e. matching on row.names) will automatically add a column Row.names which is I(row.names(x)) to the corresponding input table

Re: [Rd] xftrm is more than 100x slower for AsIs than for character vectors

2024-07-18 Thread Kurt Hornik
> Ivan Krylov via R-devel writes: Thanks: I just changed xtfrm.AsIs() as suggested. Best -k > В Fri, 12 Jul 2024 17:35:19 +0200 > Hilmar Berger via R-devel пишет: >> This can be finally traced to base::rank() (called from >> xtfrm.default), where I found that >> >> "NB: rank is not itself