1

I read csv file with fread. After that I rename one of column (the new name is My Id) using setnames() and I write.csv file. I open again with fread and everything is ok. But when I try to open with read.csv and type names() the column names appear to be My.Id Should I consider to include read.csv not to check logical variables names. How I can remove the dot between the column headings?

ribery77
  • 113
  • 1
  • 3
  • 8
  • 3
    You can prevent R from checking for syntactically valid variable names by adding `check.names = FALSE` to `read.csv`. – lukeA Jun 22 '15 at 06:43

1 Answers1

0

Column names are supposed to be valid R variable names. Try ?make.names to get some more information.

The reasoning is simple. Imagine trying to access that column. The normal syntax is df$colName. How would I do that easily with col Name? You might want them as different names when outputting them, but during use in R, you probably don't.

Steve Rowe
  • 19,175
  • 9
  • 48
  • 81