excel - reading a csv file in r where the header have comas -



excel - reading a csv file in r where the header have comas -

in excel when opening csv, can see column names separated comas e.g

rabbit,8am,carrot fox,12am,fish(salmon) 1 2 4 4 2 3 . . . . . .

when read type of file in r, reads as

rabbit..8am.carrot fox...12am..fish.salmon.. 1 2 4 4 2 3 . . . . . .

is there way read file can comas back. trying create variables column names splitting on commas.

set check.names = false when using read.table. see ?read.table

> foo <- read.table(text="rabbit,8am,carrot fox,12am,fish(salmon) 1 2 4 4", header=true, check.names = false) > foo rabbit,8am,carrot fox,12am,fish(salmon) 1 1 2 2 4 4

r excel csv

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -