> install.packages("RODBC")
> library(RODBC)
> save2excel <- function(x, tname) sqlSave(xlsFile, x, tablename = tname, rownames = FALSE, addPK = T)
> xlsFile <- odbcConnectExcel("C:\\Temp\\test.xls", readOnly = FALSE)
> temp1 <- data.frame(x = rnorm(100), y = rnorm(100))
> temp2 <- data.frame(x = rnorm(100), y = rnorm(100))
> save2excel(temp1, "test1") # Here test is the name of current sheet
> save2excel(temp2, "test2")
> odbcCloseAll()
No comments:
Post a Comment