当使用函数时sort(x),x字符在哪里,字母"y"跳到中间,紧跟在字母"i"之后:
> letters
[1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t"
[21] "u" "v" "w" "x" "y" "z"
> sort(letters)
[1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "y" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s"
[21] "t" "u" "v" "w" "x" "z"
Run Code Online (Sandbox Code Playgroud)
原因可能是我位于立陶宛,这是"立陶宛式"字母排序,但我需要正常排序.如何在R代码中将排序方法更改回正常状态?
我在Win7上使用R 2.15.2.