[R] How to attach chart to excel file?

2010-01-27 Thread johannes rara
Hi, How can I attach chart/plot to a excel file? I would like to create a plot in R eg. plot(1) and save it into a Excel file, eg. test.xls in a same working directory. Regrads, -J __ R-help@r-project.org mailing list

Re: [R] How to attach chart to excel file?

2010-01-27 Thread Henrique Dallazuanna
Try this: library(RDCOMClient) # from omegahat.org xl - COMCreate(Excel.Application) xl[[Visible]] - TRUE xl[[DisplayAlerts]] - FALSE wk - xl$Workbooks()$Add() tf - tempfile() png(tf) plot(rnorm(100), type = 'l') dev.off() wk$ActiveSheet()$Pictures()$Insert(tf) wk$SaveAs(gsub(/, ,