Please, no.  It is already annoying enough that levels are sorted 
when creating a factor.  Don't compound it by extending this to 
other functions.

In concept the order of the levels of a factor is irrelevant (although
in practice it makes a big difference, e.g. when plotting).  If so,
then why is alphabetic order preferred over any other?  Why not leave
them in the order the user provided?

Rich Raubertas
Merck & Co.

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Albrecht, Dr. Stefan (AZ Private Equity Partner)
> Sent: Thursday, April 19, 2007 11:39 AM
> To: [email protected]
> Subject: [R] rbind() of factors in data.frame [Broadcast]
> 
> Dear all,
>  
> I would like to inquire, if it is a desired feature that the 
> combination with rbind() of two data frames with factors 
> columns does not sort the factors levels of the combined data frame.
>  
> > str(rbind(data.frame(a = factor(c(4, 3))), data.frame(a = 
> factor(c(2, 1)))))
> 'data.frame':   4 obs. of  1 variable:
>  $ a: Factor w/ 4 levels "3","4","1","2": 2 1 4 3
>  
> I would expect the combined factor levels to be sorted, as 
> long as both factors are not ordered.
>  
> With many thanks and best regards,
> Stefan
>  
>  
> ____________________________________
> Dr. Stefan Albrecht, CFA
> Allianz Private Equity Partners GmbH
> Königinstr. 19 | 80539 Munich | Germany
> 
> Phone: +49.(0)89.3800.18317
> Fax: +49.(0)89.3800.818317
> EMail: [EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]> 
> Web: www.apep.com <http://www.apep.com/> 
> 
> 
> Allianz Private Equity Partners GmbH | Geschäftsführung: Wan 
> Ching Ang, Karl Ralf Jung
> Sitz der Gesellschaft: München | Registergericht: München HRB 
> 126221 | Ust-ID-Nr.: DE 813 264 786
> 
>  
> 
>       [[alternative HTML version deleted]]
> 
> 


------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments,...{{dropped}}

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to