I'm trying to load data into a data frame in R from a state education Access database. The database provides information about schools in the state, and each school has a 12-digit identifying number. When I load the table with
demo.factors <- sqlQuery(connection, "SELECT * FROM 'Demographic Factors' WHERE YEAR = 2010")
it converts this number to what appears to be scientific notation (my apologies for not having a good grasp of the inner workings here). When I try to convert them back to integers as they were in the database using
demo.factors$ENTITY_CD <- as.integer(demo.factors$ENTITY_CD)
I get a bunch of NAs and integers that do not match the original.
Is there another data type I should be using? Is there a way to either recover the original ints or to import them from the start?
Thank you so much for your help!