I found a workaround: add a colClassesdescription
data_raw <- read.table("data",
colClasses=c("character","character","character"),
sep="\t",
quote="\"")
How to convert a character to a vector:
It’s easier to use delimiters in the data, because finally you get the character and convert it, for example. vector, you should do something like:
m <- as.integer(unlist(strsplit("0,1,1,1,0",split=",")))
m
[1] 0 1 1 1 0
or
m<-as.integer(scan(textConnection("0,1,1,1,0"),sep=","))
source
share