Skip to content

sorting a data.frame using a vector

2 messages · Liaw, Andy, Peter Dalgaard

#
Well... sometimes:
[1] 155.13   0.01 156.10     NA     NA
[1] 0.37 0.00 0.37   NA   NA
[1] TRUE
_              
platform i386-pc-mingw32
arch     i386           
os       mingw32        
system   i386, mingw32  
status                  
major    2              
minor    0.1            
year     2004           
month    11             
day      15             
language R              

Cheers,
Andy
#
"Liaw, Andy" <andy_liaw at merck.com> writes:
Yes, the internals are using  

   pmatch(i, rows, duplicates.ok = TRUE)

and pmatch() is a horrible lot slower than match(). Anyone for a spot
of hardcore optimization?

(Partial matching of character indices is a feature long regretted by
its inventors, but every time we consider killing it, we tend to recoil
in horror upon realizing what it would break...)