Witold E Wolski
2014-Jul-06 10:30 UTC
[R] sort order of a character sequence is different on windose and linux (linux result)
This is the result of sorting a character sequence on a linux box (with R . 3.10)> bla = read.table("xx.txt",stringsAsFactors=F) > bla = bla[,1] > bla[1:10][1] "1000_DGFVALSK_2_run0" "1000_DGFVALSK_2_run0" "1000_DGFVALSK_2_run0" "1000_DGFVALSK_2_run0" "1000_DGFVALSK_2_run0" [6] "1000_DGFVALSK_2_run0" "1001_DGGAWGTEQR_2_run0" "1001_DGGAWGTEQR_2_run0" "1001_DGGAWGTEQR_2_run0" "1001_DGGAWGTEQR_2_run0"> sort(bla)[1:10][1] "1000_DGFVALSK_2_run0" "1000_DGFVALSK_2_run0" "1000_DGFVALSK_2_run0" "1000_DGFVALSK_2_run0" "1000_DGFVALSK_2_run0" [6] "1000_DGFVALSK_2_run0" "1001_DGGAWGTEQR_2_run0" "1001_DGGAWGTEQR_2_run0" "1001_DGGAWGTEQR_2_run0" "1001_DGGAWGTEQR_2_run0">I will send the result of sorting the content of xx.txt on windows from the windows box in a moment. the file xx.txt can be found at: https://github.com/wolski/imsbInfer/blob/master/xx.txt -- Witold Eryk Wolski
Duncan Murdoch
2014-Jul-06 11:06 UTC
[R] sort order of a character sequence is different on windose and linux (linux result)
On 06/07/2014, 6:30 AM, Witold E Wolski wrote:> This is the result of sorting a character sequence on a linux box > (with R . 3.10)See ?sort. The sort order depends on your locale. Set it to "C" for consistent ordering if that is important to you. For example, on my system:> "B" < "a"[1] FALSE> Sys.setlocale("LC_COLLATE", "C")[1] "C"> "B" < "a"[1] TRUE (but see the warning in the example in ?locales). Duncan Murdoch> >> bla = read.table("xx.txt",stringsAsFactors=F) >> bla = bla[,1] >> bla[1:10] > [1] "1000_DGFVALSK_2_run0" "1000_DGFVALSK_2_run0" > "1000_DGFVALSK_2_run0" "1000_DGFVALSK_2_run0" > "1000_DGFVALSK_2_run0" > [6] "1000_DGFVALSK_2_run0" "1001_DGGAWGTEQR_2_run0" > "1001_DGGAWGTEQR_2_run0" "1001_DGGAWGTEQR_2_run0" > "1001_DGGAWGTEQR_2_run0" >> sort(bla)[1:10] > [1] "1000_DGFVALSK_2_run0" "1000_DGFVALSK_2_run0" > "1000_DGFVALSK_2_run0" "1000_DGFVALSK_2_run0" > "1000_DGFVALSK_2_run0" > [6] "1000_DGFVALSK_2_run0" "1001_DGGAWGTEQR_2_run0" > "1001_DGGAWGTEQR_2_run0" "1001_DGGAWGTEQR_2_run0" > "1001_DGGAWGTEQR_2_run0" >> > > I will send the result of sorting the content of xx.txt on windows > from the windows box in a moment. > > the file xx.txt can be found at: > https://github.com/wolski/imsbInfer/blob/master/xx.txt > > >