Re: [R] a question of alphabetical order

2008-04-16 Thread Hans-Joerg Bibiko
Hi, as already mentioned, sorting could be a pain. My solution to that is to write my own order routine for a given language. The idea is to transform the UTF-8 string into ASCII in such a way that the built-in order routine outputs the desired result. But this could be a very stony way.

Re: [R] a question of alphabetical order

2008-04-16 Thread [Ricardo Rodriguez] Your XEN ICT Team
Thanks Hans! Hans-Joerg Bibiko wrote: Hi, as already mentioned, sorting could be a pain. My solution to that is to write my own order routine for a given language. The idea is to transform the UTF-8 string into ASCII in such a way that the built-in order routine outputs the desired

Re: [R] a question of alphabetical order

2008-04-16 Thread [Ricardo Rodriguez] Your XEN ICT Team
Hans-Joerg Bibiko wrote: Hola, Muchas gracias! This is new to me. I learnt Spanish a bit - well - 20 years ago ;) But this simplifies it. This change happens just 14 years ago! You you are not guilty! Recuerdos Hans Saludos cordiales! Read you in Spanish whenever you want! Ricardo

[R] a question of alphabetical order

2008-04-15 Thread [Ricardo Rodriguez] Your XEN ICT Team
Hi all, In Spanish vowels with accent like á, é, ... doesn't affect to the alphabetical order of vector of strings. I mean, a or á don't matter for establishing the alphabetical order. Nevertheless, while working with R order, here is what I get. Given a file transport.txt medio#variable

Re: [R] a question of alphabetical order

2008-04-15 Thread Prof Brian Ripley
This is a known Mac OS X bug, nothing to do with R which uses the system functions (strcoll/wcscoll) for such things. If you look at the help for sort, it refers you to ?Comparison. Which says Comparison of strings in character vectors is lexicographic within the strings using the

Re: [R] a question of alphabetical order

2008-04-15 Thread [Ricardo Rodriguez] Your XEN ICT Team
Tricky question, this order issue :-( Thank you so much for the detailed explanation. Thus, please, must I conclude that I will have to survive with this ASCII order while working in Mac OS X 10.5.2 until Mac people fix this bug? You spoke about es_ES.ISO8859-15 in Mac. Will it do the trick?

Re: [R] a question of alphabetical order

2008-04-15 Thread [Ricardo Rodriguez] Your XEN ICT Team
Almost done... Sys.setlocale(category = LC_ALL, locale = es_ES.ISO8859-15) The order is now correct, but it renders incorrectly most of the non-ASCII characters, both in console: 1 √\201guilas de mantenimiento 1.97 NA 1.72 2 √\201ngeles de la CONAGUA 1.77 1.97 1.94 And in quartz():

Re: [R] a question of alphabetical order

2008-04-15 Thread Prof Brian Ripley
On Wed, 16 Apr 2008, [Ricardo Rodriguez] Your XEN ICT Team wrote: Almost done... Sys.setlocale(category = LC_ALL, locale = es_ES.ISO8859-15) The order is now correct, but it renders incorrectly most of the non-ASCII characters, both in console: 1 √\201guilas de mantenimiento 1.97 NA 1.72 2