"Petr Savicky" <savi...@cs.cas.cz> wrote in message news:20120220105153.gc21...@cs.cas.cz... > On Mon, Feb 20, 2012 at 02:18:42AM -0800, statquant2 wrote: >> Hi all, I am having difficulties to understand how R sort strings: >> >> If I do >> R) sort(c("X.","X0B")) >> [1] "X." "X0B" >> >> So for me, as far as lexicographic order is concerned I can add whatever >> to >> the end, the order will remain the same, but : > > Hi. > > This neednot be true for strings of different length. > For example > > ab > abc > > become by concatenation with z > > abcz > abz > > Petr Savicky. >
That's not the explanation in this case. The OP isn't telling us everything. I get [R version 2.14.1 Platform: i386-pc-mingw32/i386 (32-bit)]: > sort(c("X.","X0B")) [1] "X." "X0B" > sort(c("X.Z","X0B.Z")) [1] "X.Z" "X0B.Z" KJ ______________________________________________ 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.