Ivan:
AFAICS you did not read my post carefully enough. Unquoted improper
identifiers trigger an error because the input cannot be parsed. It
has nothing to do with data.frame() .(**R EXPERTS, PLEASE CORRECT IF
WRONG**). Unquoted LEGAL names are accepted because that's how R works
-- they can be p
Sorry, I meant check.names = FALSE (d'oh!)
Michael
On Tue, Jan 24, 2012 at 11:33 AM, R. Michael Weylandt
wrote:
> I've usually understand the restrictions on syntactic names as being
> tied to the parser.
>
> E.g., how could R tell the difference between
>
> d <- data.frame(a = 3, `a-2` = 3, che
I've usually understand the restrictions on syntactic names as being
tied to the parser.
E.g., how could R tell the difference between
d <- data.frame(a = 3, `a-2` = 3, check.names = TRUE)
d$a-2 ## Equal to 1 or 3 ?
One of those strange eval things that makes alot of sense for an
interactive lan
Bert,
Thank you for correcting my inaccuracy. A quick look at the original
question might help you understand what I meant:
d<- data.frame(x = c(0, 1))
d<- data.frame(d, y = c(0,1))
names(d)[2]<- "a.-5"
d
x a.-5
1 00
2 11
d1<- data.frame(d, y = c(0,1))
d1
x a..5 y
1 00 0
2 11
Ivan:
On Tue, Jan 24, 2012 at 6:47 AM, Ivan Calandra
wrote:
> By "it works anyway", I mean that you can have a dash in a column name,
> there is no error or even warning.
> I guess that some functions would throw an error or warning, depending on
> the requirements, but data.frame() doesn't.
Thi
By "it works anyway", I mean that you can have a dash in a column name,
there is no error or even warning.
I guess that some functions would throw an error or warning, depending
on the requirements, but data.frame() doesn't.
Ivan
Le 24/01/12 15:35, David Winsemius a écrit :
On Jan 24, 2012,
uot;valid" since it works anyway.
The dash is not a valid character for column names. What do you mean
by "it works anyway"?
--
David.
You can set up the check.names argument to FALSE when you call
data.frame().
HTH,
Ivan
---- Message original ----
Sujet: [R] Column
check.names argument to FALSE when you call data.frame().
HTH,
Ivan
Message original ----
Sujet: [R] Column name containing "-"
Date : Tue, 24 Jan 2012 20:34:07 +1100
De :Mark Seeto
Pour : r-help@r-project.org
I'm trying to create a data frame in which some of
I'm trying to create a data frame in which some of the column names
contain a dash "-". A simple example:
d <- data.frame(x = c(0, 1))
d <- data.frame(d, y = c(0,1))
names(d)[2] <- "a.-5"
d
x a.-5
1 00
2 11
d <- data.frame(d, y = c(0,1))
d
x a..5 y
1 00 0
2 11 1
names(d)[2] <
9 matches
Mail list logo