문제

I am trying to import data from an Access database into R. I would like to import the CIP codes for some majors, which can contain leading zeros. RODBC is converting the CIP code to a numeric value even though it is defined as text in Access. Can anyone shed light on how I can coerce this field into a text field on import?

도움이 되었습니까?

해결책

Try using the argument as.is = TRUE in the sqlQuery function. That usually does the trick for me.

다른 팁

library(RODBC)
channel=odbcConnectAccess2007("plz.accdb")
plz = sqlQuery(channel,"SELECT * from PLZ",as.is=TRUE)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top