[R] Transferring R results to word prosessors

From: Tom Backer Johnsen <backer_at_psych.uib.no>
Date: Fri 10 Feb 2006 - 08:37:26 EST

There has been an incredible number of responses in a short time, with a number of different suggestions. With hindsight, I must admit I have not been quite clear, so additional (somewhat lengthy) explanation is needed.

I want to use R in an introductory course on multiple regression (among other things) starting in two weeks time for students of psychology at my University. These students are very much used to MS Word, it is in principle possible to get them to adopt OpenOffice (which I would like to), but I regard Latex to be out of the question.

One of the things they are drilled on is that they have to produce term papers etc. based on a template in APA (American Psychological Association) format. Among other things, this means that the document must be all text apart from the graphics. Therefore any kind of solution involving pictures of tables rather than the tables / results as text is out. Same holds for all kinds of "mixed" output, so combinations of text with PDF elements. Besides, the tables in R are not that nice in respect to the formatting. Since the content is the main thing anyhow, that does not matter. In most cases, the tables have to be tweaked as least to some extent. Given my inexperience, it seems that the R2HTML path is so far the most promising (but for me untried so far)

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.


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 10:10:42 2006

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