[R] naming columns of data frame

Katharine Mullen kate at few.vu.nl
Sun Sep 16 01:28:45 CEST 2007


when I try what you describe there is no problem -maybe send a
reproducible example.

> x<-data.frame(matrix(2,2,2))
> colnames(x) <- c("1.xx", "2.xx")
> x
  1.xx 2.xx
1    2    2
2    2    2


On Sat, 15 Sep 2007, kevinchang wrote:

>
> Hey,
>
> I am trying to make a data frame and the name of a column is composed of a
> number, a dot, and a word, such as "1.whatever". But I always get this error
> message:"syntax error, unexpected SYMBOL, expecting ',' in:" while printing
> data frame out . When I rename the column with purely letter, everything
> works fine. Some suggestion about the cause/ solution ?? Thanks.
> --
> View this message in context: http://www.nabble.com/naming-columns-of-data-frame-tf4449324.html#a12694795
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list