Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R: read.csv adding sub-script "X" in header

Tags:

r

header

I have a data frame that has headers as this

Name  0x1  1x2

read.csv changes the header to be

Name X0x1 X1x2

Is there a way, where this can be avoided?

Thanks.

like image 558
Rachit Agrawal Avatar asked Jul 09 '13 12:07

Rachit Agrawal


2 Answers

according to @Joshua

read.csv("filename.csv",check.names=FALSE)
like image 160
Metrics Avatar answered Sep 24 '22 15:09

Metrics


I had the same issue on my Mac. There was a X... at the beginning of the first variable. The problem was that the CSV file was actually a CSV UTF-8 (Comma delimited) file. Saving the file as a CSV (Comma separated values) solved it.

like image 44
Ramon Avatar answered Sep 26 '22 15:09

Ramon