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()
Write some data to a excel spreadsheet just
write.csv(rnorm(10),"some file",sep=",")
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?
Thanks,
I would use the xlsx
package. Check out the addPicture
function and the addDataFrame
function. I found this package fairly easy to work with.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With