The following code shows that the unlisted data frame assigns an index to
each member. When one sorts the data frame based on ULST, he in fact uses
the (implicit) indices of ULST but not the actual values! Therefore, your
guess is correct.

> test.vec=data.frame(c("A","F","C"))
> ULST=unlist(test.vec)
> ULST
c..A....F....C..1 c..A....F....C..2 c..A....F....C..3 
                A                 F                 C 
Levels: A C F

> sort(as.vector(ULST),index.return=T)
$x
[1] "A" "C" "F"

$ix
[1] 1 3 2

# also the rank and he index are different
> rank(ULST)
c..A....F....C..1 c..A....F....C..2 c..A....F....C..3 
                1                 3                 2 





-- 
View this message in context: 
http://r.789695.n4.nabble.com/Non-standard-sorts-on-vectors-tp2340431p2384591.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org 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