[R] How to Arrange character vector in alphabetic order

Liaw, Andy andy_liaw at merck.com
Wed Aug 25 21:32:59 CEST 2004


You mean as in:

> x <- c("aaa", "abc", "ab", "d")
> sort(x)
[1] "aaa" "ab"  "abc" "d"  

??

Andy

> From: Yao, Minghua
> 
> Hi,
>  
> Is there any function that can arrange a character in 
> alphabetic order? Thanks for answer
>  
> -MY




More information about the R-help mailing list