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
Post a Comment