[R] sort() leaves row names unaffected

Liaw, Andy andy_liaw at merck.com
Tue Dec 14 14:41:12 CET 2004


I don't see how this is the `same' question at all.  The object Martin has
doesn't look like a data frame (can you tell why?), so I believe is
unrelated to what you asked before.

Andy

ps: Why is this copied to debian_list at web.de?


> From: bogdan romocea
> 
> I asked the same question a few weeks ago. See
> http://tolstoy.newcastle.edu.au/R/help/04/11/6775.html
> 
> 
> -----Original Message-----
> From: Martin Wegmann
> Sent: Tuesday, December 14, 2004 6:23 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] sort() leaves row names unaffected
> 
> 
> Hello, 
> 
> I wonder if I ran into a bug. If I do 
> 
> summary(df1$X1) -> df1.y
> 
> df1.y
> a  b   c   d  e
> [1,] 50.74627 8.955224 17.91045 19.40299 2.985075
> 
> sort(df1.y) 
>        a  b   c   d  e
> [1,] 2.985075 8.955224 17.91045 19.40299 50.74627
> 
> my numbers are sorted but do not anymore correspond to the rownames. 
> For me it is counterintuitive that solely the numbers are sorted and
> not the 
> names. Is there a way to sort names + numbers or is this behaviour of
> sort() 
> unintended?
> 
> Martin
> 
> R 2.0.1-1 debian reposit.
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
> 
> 
> 
> 		
> __________________________________ 
> 
> Dress up your holiday email, Hollywood style. Learn more.
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
>




More information about the R-help mailing list