read.table reads “T” as TRUE and “F” as FALSE, how to avoid?
I have a file with the data c("A","T","B","F") . When I use: read.csv(myfile,header=F,stringsAsFactors=F) R interprets character T as TRUE and F as FALSE Am I doing anything wrong? If all your columns are characters then try this: # replace text = . with your filename read.csv(text="A,B,T,T", header=FALSE, stringsAsFactors=FALSE, colClasses = c("character")) Else, you'll have to pass the type of each column in colClasses as: colClasses = c("numeric", "numeric", "character", ...) I came across to similar problem here is the solution: #dummy data df <- read.csv(text=" A,B,T,T,F T,T,F,T,text1 A,T