[R] Naming Convention
Eric Lecoutre
lecoutre at stat.ucl.ac.be
Thu Jan 13 10:50:18 CET 2005
Hi,
Not right: any entry is allowed as long as it is a character. Though, some
are not recommanded...
See:
> M=diag(2)
> rownames(M)=c("with a space", "without")
> colnames(M) <- c("%*%","~")
> M
%*% ~
with a space 1 0
without 0 1
Problem araised for data.frame if you want to access to column by names:
> M <- as.data.frame(M)
> M$~
Error: syntax error
> M$"~"
[1] 0 1
(same problem if name contains any other operator or a space)
Eric
At 10:32 13/01/2005, Christoph Scherber wrote:
>Dear Reinhold,
>
>All entries are allowed except "price swap" or "price_swap"
>
>Of course it´s most convenient to use short names and small letters for
>quicker
>typing.
>
>Regards
>Christoph
>
>
>
>Quoting "Hafner, Reinhold (Risklab)" <Reinhold.Hafner at risklab.de>:
>
> > I was wondering whether there exists a naming convention for row and column
> > names in R data frames and matrices.
> > E.g: PriceSwap or PRICESWAP or PRICE.SWAP
> >
> > Many thanks.
> > Reinhold
> >
> >
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
> >
>
>
>
>
>----------------------------------------------------------------
>This mail was sent through http://webmail.uni-jena.de
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Eric Lecoutre
UCL / Institut de Statistique
Voie du Roman Pays, 20
1348 Louvain-la-Neuve
Belgium
tel: (+32)(0)10473050
lecoutre at stat.ucl.ac.be
http://www.stat.ucl.ac.be/ISpersonnel/lecoutre
If the statistics are boring, then you've got the wrong numbers. -Edward
Tufte
More information about the R-help
mailing list