[R] Windows / Accented characters / pb with makename

Yves Gauvreau cyg at sympatico.ca
Tue Aug 29 12:42:36 CEST 2000


Here is what I get on my NT box under english locale or french. It seems I
have no problem.

> polut <- data.frame(Mortalité=c(82,97,76), Densité=c(600,960,570),
Pollution=c(110,140,90))
> attach(polut)
> summary(Mortalité)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
   76.0    79.0    82.0    85.0    89.5    97.0
> summary(Pollution)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
   90.0   100.0   110.0   113.3   125.0   140.0
> version
         _
platform Windows
arch     x86
os       Win32
system   x86, Win32
status
major    1
minor    1.0
year     2000
month    June
day      15
language R



----- Original Message -----
From: "Prof Brian D Ripley" <ripley at stats.ox.ac.uk>
To: "Charles RAUX" <Charles.Raux at let.ish-lyon.cnrs.fr>
Cc: "r-help" <r-help at stat.math.ethz.ch>
Sent: Tuesday, August 29, 2000 2:27 AM
Subject: Re: [R] Windows / Accented characters / pb with makename


> On Mon, 28 Aug 2000, Charles RAUX wrote:
>
> > Thank you for the hint (I didn't know makename). In fact contrary to
> > what is indicated in help makename doesn't give legal R names
> > (at least under Windows).
> > See below:
> >
> > > make.names("aéaéaéaùàééé")
> > [1] "aéaéaéaùàééé"
> >
> > 2) What is a "legal R name"? (found nowhere in FAQ, help...)
>
> That's the problem. In S it is a-zA-Z0-9 plus `.'.  In R it would appear
to
> be those characters which are regarded as alphanumeric in the locale in
use
> plus `.' (Via a call to isalnum in both make.names and the parser.) Now
> it's hard for me to test this, but I think in a French locale those chars
> should be legal in names.  They are not in the C or en_UK locales, and
> make.names on Windows does work in those locales.
>
> There is something rather peculiar about locale support on Windows,
> and for 1.2.0 R will have ways to override this.  Can someone who
> has a non-C Unix locale let me know if there the non-English letters
> are valid in names?   (What my experiments would suggest is that
> Windows messed up the locale setting, and that may still be the case.)
>
> I had two suggestions to offer:
>
> a) You can use non-legal names by quoting them. So
>
> summary(pollut$"Mortalite")  (my mailer loses the accented char)
>
> should work.
>
> b) Use chartr to translate the accented chars to their non-accented
> equivalents.
>
>
> --
> Brian D. Ripley,                  ripley at stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272860 (secr)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-.-
> r-help mailing list -- Read
http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
>
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._
>

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list