Re: [R] Transferring R results to word prosessors

From: Doran, Harold <HDoran_at_air.org>
Date: Fri 10 Feb 2006 - 22:09:52 EST


I didn't follow this thread entirely, but I did make a LaTeX recommendation and I know that wasn't what you were asking for. But, if I may, let me respond to the ideas you present below in an attempt to be somewhat persuasive.

IMHO, this are horrible inefficiencies of SPSS and other packages, not virtues. To do what you are suggesting requires that one work in two environments, word and SPSS. If the researcher changes their analysis or wants to tweak the data, then you rerun the analysis, go back to SPSS copy and paste again. Why would someone want to do this when a much more efficient method exists?

Instead, with Sweave, you embed your R code inside the LaTeX document and work in a *single* environment. There is no need to copy and paste and if the data or analysis changes, you update your document very easily saving time, effort, and room for errors. In addition, the tables look much better than word, which (again IMHO) is an aggregiously bad program to begin with.

Using this method, you can place any R code in the document, including graphics, tables (say with xtable) or anything. There is never a need to copy and paste as there is a wonderful, seemless effort between the two programs. Because LaTeX has options for presentations, one can easily create slides that look much better than ppt using a similar method saving hours of effort in my experience.

So, instead of getting R to do what other less sophisticated programs do, which is an effort backwards into the old, and inefficient, ways of doing things, R is moving progressively forward and offers these similar capabilities, but in a much more efficient manner.

Last, if your students are doing technical work, I would suggest they should be familiar with TeX anyhow. It is free, easy to use and learn, offers significant advances alongside R, and equations actually look like equations. BTW, creating and numbering equations in word is about the most difficult effort on earth!

Just my two cents,
Harold

One of the nice things about SPSS and Statistica is that it is VERY easy to copy and paste output from the program right into the paper / paper. A commmon trick when using SPSS is to first paste the output into a spreadsheet (e.g. Excel), and from there into the document. In any case, the outcome is that the output is a table (not a table in the R sense) in the document, which may be edited, tweaked, adding borders etc.. So, what I am looking for is a process starting with output from R (like what is obtained from the summary(lm (...)) command, the output of a correlation matrix, or ...) that could end up as a table in MS Word (and probably in OpenOffice as well) in the smallest number of steps.

For instance, if there was an option in R which had the effect that the spaces separating things (e.g. the columns in the output of a correlation matrix or the elements in an ANOVA table) were replaced by tabs, everything would be very simple. Then, you could (a) paste the output into the document, and (b) do a simple text-to-table conversion in Word after the paste. A simple affair with a few simple steps. Ideally, what I want for me and my students is this or a similar solution to this problem. That might be a good selling argument for R as well.

Tom



R-help@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

        [[alternative HTML version deleted]]



R-help@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 Received on Fri Feb 10 22:29:11 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:27 EST