r - read.table reads "T" as TRUE and "F" as FALSE, how to avoid? -
i have file data c("a","t","b","f")
.
when use:
read.csv(myfile,header=f,stringsasfactors=f)
r interprets character t
true
, f
false
am doing wrong?
if columns characters try this:
# replace text = . filename read.csv(text="a,b,t,t", header=false, stringsasfactors=false, colclasses = c("character"))
else, you'll have pass type of each column in colclasses
as: colclasses = c("numeric", "numeric", "character", ...)