如何使用R将具有不同列的多个数据帧导出或附加到单个Excel工作表中

时间:2014-06-17 13:53:49

标签: r

我尝试XLconnectXlsx,但徒劳无功。

代码如下。

require(XLConnect)
require(xlsx)

a<-read.xlsx("C:\\R\\CPC2.xlsx",1,as.data.frame=TRUE)

b<-read.xlsx("C:\\R\\CPCVoucher1.xlsx",1,as.data.frame=TRUE)

wk <- loadWorkbook("XLConnectExample1.xlsx", create = TRUE)
writeWorksheet(wk, a, sheet = "test", startRow = 1, startCol = 2)

writeWorksheet(wk,b, sheet = "test", startRow = 15, startCol = 2)

saveWorkbook(wk)

0 个答案:

没有答案