I am trying to read an MS Access database with the package("RODBC").
library("RODBC")
db<-file.path("file.accdb")
channel<-odbcConnectAccess2007(db)
dataSetName<-sqlFetch(channel,"file")
close(channel)
It works, but when I have numeric values starting by 0, for instance 089, the package reads it as integer and converts it in 89, it removes the zero. So, I would like to read the entire database as factors or characters to avoid this. I was wondering if there is an argument to solve it. Thanks in advance.
To read the entire database as characters (if possible):
dataSetName<-sqlFetch(channel,"file", as.is=TRUE)
For factors I am not completely sure. stringsAsFactors = TRUE might work.
dataSetName<-sqlFetch(channel,"file", stringsAsFactors = TRUE)