[R] RODBC: forcing a special column to be read in as character

RINNER Heinrich HEINRICH.RINNER at tirol.gv.at
Wed Oct 13 14:59:53 CEST 2010


Dear R-users,

I am working with R version 2.10.1 and package RODBC Version: 1.3-2 under windows.

Say I have a table "testtable" (in an Access data base), which has many different columns, among them a character column "X" with "integer-like" data as "0012345".
Using sqlFetch, I'd like to assure that column X is read in as a character variable. So what I'm looking for is something between these two approaches:

> sqlFetch(channel, "testtable") # -> column X is automatically converted to character (so 0012345 becomes 12345)
> sqlFetch(channel, "testtable", as.is = TRUE) # -> all columns are converted to character

I guess I'm looking for something like argument "colClasses" in function "read.table", is there a something similar in RODBC?

Your advice is appreciated;
kind regards
Heinrich.



More information about the R-help mailing list