[R] Exporting a data.frame to excel using sqlSave - adds a character ' to values

Tal Galili
2010-01-18T10:38:17Z

Hi all,

I am using RODB to export multiple data.frames into one excel file with
multiple sheets.
One thing I can't seem to unserdatand is way the command adds the character:
'
To the beginning of each of my (non numeric) values.

Here is an example code:


library(RODBC)
library(MASS)
data(anorexia)
save2excel <- function(x, t.name) sqlSave(xlsFile, x, tablename = t.name,
rownames = FALSE)
xlsFile <- odbcConnectExcel("C:\\output-table.xls", readOnly =
FALSE)
save2excel(anorexia, "temp")
odbcCloseAll()



So the output file has
*'*Treat
instead of:
Treat
In cell - A1

Thanks,
Tal






----------------Contact
Details:-------------------------------------------------------
Contact me: Tal.Galili@gmail.com |  972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com/ (English)
----------------------------------------------------------------------------------------------

	[[alternative HTML version deleted]]