将图像和数据从R导出到Excel电子表格 [英] Export both Image and Data from R to an Excel spreadsheet
本文介绍了将图像和数据从R导出到Excel电子表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
打印图像并将其保存在磁盘上很简单:
It is simple to print an image and save it on disk just:
fit <- lm(some ~ model)
png(filename="your/file/location/name.png")
plot(fit)
dev.off()
仅将一些数据写入Excel电子表格
Write some data to a excel spreadsheet just
write.csv(rnorm(10),"some file",sep=",")
我的问题是,如何将以上两者重定向到电子表格中.换句话说,在Excel工作簿上输出与一些图像/绘图配对的图形吗?
My question is how would one redirect both the above in to a spreadsheet. Another word, output a graph paired withs some image/plot on to a excel workbook?
谢谢
推荐答案
我会使用xlsx
包.检出addPicture
功能和addDataFrame
功能.我发现此程序包相当容易使用.
I would use the xlsx
package. Check out the addPicture
function and the addDataFrame
function. I found this package fairly easy to work with.
这篇关于将图像和数据从R导出到Excel电子表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文