See ?Comparison, which holds some warnings about what to expect when sorting strings.


Am 20.02.2012 11:51, schrieb Petr Savicky:
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.

______________________________________________
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.


--
Enrico Schumann
Lucerne, Switzerland
http://nmof.net/

______________________________________________
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