我在 R 中有几个矩阵,并希望将它们作为单独的工作表导出到现有工作簿。关于如何解决这个问题的任何想法?
问问题
1314 次
2 回答
4
看看XLConnect库:
d <- matrix( rnorm(1000), ncol = 10 )
require(XLConnect)
wb <- loadWorkbook( "wb.xlsx", create=FALSE )
createSheet(wb, name="sheet1")
writeWorksheet( wb, as.data.frame(d), sheet="sheet1" )
saveWorkbook(wb)
于 2012-06-27T08:27:55.390 回答
0
require(XLConnect)
wb <- loadWorkbook( "wb.xls", create=TRUE )
createSheet(wb, name="sheet1")
writeWorksheet( wb,as.data.frame(A), sheet="sheet1" )
Error: IllegalArgumentException (Java): Sheet index (0) is out of range (0..-1)
saveWorkbook(wb)
于 2013-05-21T12:05:42.847 回答