[R-sig-DB] A question about dbWriteTable command in R under MS Windows
Christophe Dutang
dut@ngc @end|ng |rom gm@||@com
Tue Mar 10 22:41:36 CET 2009
Hi,
try with the latest version R, i.e. 2.8.1 and tell us which version of
mysql and rmysql do you use.
Le 10 mars 09 à 22:32, HU,ZHENGJUN a écrit :
> Dear Sir/Madam,
>
> I wrote the following R code (see below) to store the data frame of
> "test.01" into the table of "ttest01" in my database which is
> located on a Linux machine. If the code was run under MS Windows XP,
> I have found that the values in the last column (i.e. column f5) in
> the table are all zeros instead of NULLs. If the same R code was run
> under Linux, however, everything is OK. The R version is 2.6.0 under
> both MS Windows XP and Linux.
>
> Does anyone know how to solve this problem under MS Windows XP?
>
> Thank you very much for the help and time in advance. Howard
>
> ********************************************************************************************
> library(DBI)
> library(RMySQL)
> mysqldrv <- dbDriver("MySQL")
> conn.2.database<-
> dbConnect('myHostName','myUserName','myPassword','myDatabaseName')
> test.
> 01
> =
> data
> .frame
> (f1
> =
> c
> ("A
> ","B","C"),f2=c(1,2,3),f3=c(NA,NA,NA),f4=c(NA,NA,NA),f5=c(NA,NA,NA))
> dbWriteTable(conn.2.database, "ttest01", test.01, row.names=F,
> eol='\r\n')
> dbDisconnect(conn.2.database)
>
> _______________________________________________
> R-sig-DB mailing list -- R Special Interest Group
> R-sig-DB using stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-db
--
Christophe Dutang
Ph. D. student at ISFA, Lyon, France
website: http://dutangc.free.fr
More information about the R-sig-DB
mailing list