Hi I have just started to have a look at R. I have used most stats software packages and can use perl, visual basic etc. I am interested in how well it handles lots of output e.g. tables or charts. How would you get lots of output most easily and quickly into a Word document? Sharon Snowdon ------------------------------------------------------------------------ - FIGHT BACK AGAINST SPAM! Download Spam Inspector, the Award Winning Anti-Spam Filter http://mail.giantcompany.com -- 7/14/2006
Hi, you might try to use the R2HTML package and then import the html files into word. please see. http://cran.r-project.org/doc/Rnews/Rnews_2003-3.pdf Another way: use sweave for tex/latex output and transform it to rtf. Friedrich Schuster --- Your post was: sharon snowdon sharonsnowdon at fastmail.fm Hi I have just started to have a look at R. I have used most stats software packages and can use perl, visual basic etc. I am interested in how well it handles lots of output e.g. tables or charts. How would you get lots of output most easily and quickly into a Word document? Sharon Snowdon
If its text that you want included in a larger Word document you can create a text or HTML file from R and then when inserting it into Word insert it as a link rather than copying it in. output a file from R In Word Insert | File browse to the file so its name appears in the File name box click on the down arrow to the right of the Insert button and choose Insert as Link If you regenerate the file in the future your Word document gets automatically uipdated. Another possibility is either the rcom and RDCOMClient packages which allow one to control Word from R by treating Word as a COM object. This allows detailed control of Word but is more work. e.g. Here we create a Word document from scratch. Note that you must be running Windows and have Word on the machine where you do this: library(RDCOMClient) ow <- COMCreate("Word.Application") ow[["Visible"]] <- TRUE # optional od <- ow[["Documents"]]$Add() od[["PageSetup"]][[LeftMargin"]] <- 20 od[["PageSetup"]][["TopMargin"]] <- 20 od[["Content"]][["Font"]][["Size"]] <- 11 od[["Content"]][["Text"]] <- "Hello World" od$SaveAs("\\mydoc.doc") ow$Quit() On 7/17/06, sharon snowdon <sharonsnowdon at fastmail.fm> wrote:> Hi > > I have just started to have a look at R. I have used most stats software > packages and can use perl, visual basic etc. I am interested in how well > it handles lots of output e.g. tables or charts. How would you get lots > of output most easily and quickly into a Word document? > > Sharon Snowdon > > > > ------------------------------------------------------------------------ > - > FIGHT BACK AGAINST SPAM! > Download Spam Inspector, the Award Winning Anti-Spam Filter > http://mail.giantcompany.com > > > > -- > > > > 7/14/2006 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >
R can handle as many graphs/table as you ask it to. I don't know what you're trying to do, but I generate lots of graphs using loops and generating filenames on the spot. See FAQ 7.34 to see how it's done. http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-save-the-result-of-each-iteration-in-a-loop-into-a-separate-file_003f For graphs, save the graphs as something windows can recognize (jpeg, png, emf, wmf...) and in Word, you can easily import all the graphs in a directory by doing Insert/Picture/From File and shift-click all the graphs you want. Word will import them all. For tables, it really depends on what you want because usually there is formatting involved. Personnaly, if I had to produce several tables to be imported in Word, I would use the R2HTML library in a loop (as mentionned above) and import the multiple html files using Insert/File (and shift-click) in Word. Neuro>From: "sharon snowdon" <sharonsnowdon at fastmail.fm> >Reply-To: sharonsnowdon at fastmail.fm >To: <r-help at stat.math.ethz.ch> >Subject: [R] Output and Word >Date: Tue, 18 Jul 2006 06:35:38 +1000 > >Hi > >I have just started to have a look at R. I have used most stats software >packages and can use perl, visual basic etc. I am interested in how well >it handles lots of output e.g. tables or charts. How would you get lots >of output most easily and quickly into a Word document? > >Sharon Snowdon > > > >------------------------------------------------------------------------ >- >FIGHT BACK AGAINST SPAM! >Download Spam Inspector, the Award Winning Anti-Spam Filter >http://mail.giantcompany.com > > > >-- > > > >7/14/2006 > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! >http://www.R-project.org/posting-guide.html>From: "sharon snowdon" <sharonsnowdon at fastmail.fm> >Reply-To: sharonsnowdon at fastmail.fm >To: <r-help at stat.math.ethz.ch> >Subject: [R] Output and Word >Date: Tue, 18 Jul 2006 06:35:38 +1000 > >Hi > >I have just started to have a look at R. I have used most stats software >packages and can use perl, visual basic etc. I am interested in how well >it handles lots of output e.g. tables or charts. How would you get lots >of output most easily and quickly into a Word document? > >Sharon Snowdon > > > >------------------------------------------------------------------------ >- >FIGHT BACK AGAINST SPAM! >Download Spam Inspector, the Award Winning Anti-Spam Filter >http://mail.giantcompany.com > > > >-- > > > >7/14/2006 > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! >http://www.R-project.org/posting-guide.html
Others have suggested using R2HTML (which is a good option). Another option is to use Sweave and specifically the new odfWeave package for R. This works on OpenOffice files rather than word files (but OpenOffice http://www.openoffice.org/ can inport and export word documents). The basic idea is to write your report in OpenOffice (or LaTeX or HTML), but anywhere that you want statisticial output (graphs, tables) you include instead the R code to produce the table, graph, or whatever. Run this file through R (using Sweave or odfWeave) and the resulting file has replaced all the code segments with their output. The documentation with odfWeave has examples. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at intermountainmail.org (801) 408-8111 -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of sharon snowdon Sent: Monday, July 17, 2006 2:36 PM To: r-help at stat.math.ethz.ch Subject: [R] Output and Word Hi I have just started to have a look at R. I have used most stats software packages and can use perl, visual basic etc. I am interested in how well it handles lots of output e.g. tables or charts. How would you get lots of output most easily and quickly into a Word document? Sharon Snowdon ------------------------------------------------------------------------ - -- ______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible Url : https://stat.ethz.ch/pipermail/r-help/attachments/20060719/77ff81ff/attachment.pl
On page 2 of the manual, Section 2 ("Requirements") has "The package also requires a utility to zip and unzip compressed files, such as unzip, Winzip or jar." With a footnote that unzip can be found at http://www.info-zip.org/ for free. You can use any utility that can zip/unzip pkzip formatted files. If you want to use something else, you can. See ?odfWeaveControl. I didn't use utils::zip.unpack since there did not appear to be an analogous utility for re-zipping the file. Is this incorrect? I will put an automatic check on package startup for the above utilities and print a warning if nothing is found. Max> 0n Wed, 19 Jul 2006, David Hajage wrote: > > > thank you Greg Snow for this information ! > > > > But I have this message : > > > > > odfWeave("c:/simple.odt", "c:/essai.odt") > > Setting wd > > Copying c:/simple.odt > > Decompressing ODF file using unzip -o > > "C:\DOCUME~1\Maud\LOCALS~1\Temp\RtmpF0hdqb/simple.odt" > > Erreur dans odfWeave("c:/simple.odt", "c:/essai.odt") : > > Error unzipping file > > De plus : Warning message: > > unzip introuvable > > > > R says that it doesn't find "unzip"... What is this program ? > > It is in the Rtools.zip bundle used to build source packages for Runder> Windows (your unstated OS, it seems). > > However, you should take this up with the package maintainer, as R hasthe> capability to unzip files builtin (utils::zip.unpack) on Windows. > > > > > 2006/7/18, Greg Snow <Greg.Snow at intermountainmail.org>: > > >---------------------------------------------------------------------- LEGAL NOTICE\ Unless expressly stated otherwise, this messag...{{dropped}}