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("/", "\\\\", file.path(getwd(), "test.xls"))) wk$Close() xl$Quit() xl <- NULL On Wed, Jan 27, 2010 at 8:21 AM, johannes rara <johannesr...@gmail.com> wrote: > 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 > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.