tags:

views:

85

answers:

1

I'm trying to understand how RODBC determines the column types of a newly created (Access) table? The R documentation of sqlSave is very cryptic: "types are selected by consulting arguments varTypes and typeInfo". And no examples for this arguments. Where can I find a better explanation?

+3  A: 

Just look at the sources of the RODBC package.

# from R/TypeInfo.R:
typesR2DBMS <-
    list(MySQL = list(double="double", integer="integer",
         character="varchar(255)", logical="varchar(5)"),
         ACCESS = list(double="DOUBLE", integer="INTEGER",
         character="VARCHAR(255)", logical="varchar(5)"),
         # etc ...
rcs
Where can I find that?
waanders
http://cran.r-project.org/src/contrib/RODBC_1.3-2.tar.gz, File R/TypeInfo.R, Line 41
rcs
Thanks. But I'm using Windows, my C:\Program Files\R\R-2.10.1\library\RODBC directory doesn't contains TypeInfo.R. Is there no example on the net?
waanders
You have to download the source package from the link above to view the source of `TypeInfo.R`
rcs
@rcs, fantastic answer. I love that you pulled from the source and then gave a reference to where in the source it came from. That's excellent.
JD Long