[R] Transferring R results to word prosessors

Tom Backer Johnsen backer at psych.uib.no
Fri Feb 10 21:21:57 CET 2006


At 17:10 09.02.2006 -0600, you wrote:
>Tom Backer Johnsen wrote:
>>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)
>
>There's nothing wrong with the APA template; it will work well with LaTeX.

I am sure you are right.  But I do not think it is worth the trouble, 
neither for me nor the students in respect to this course, to force them 
into learn LaTex.  They have been using this type of package almost since 
kindergarten (well, not quite).  For me, it is a MUCH simple solution to 
show them how the transfer can be done to with simple copy and past 
operations.  They will not be doing that operation very often anyhow.

>>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
>
>You have not seen the various R/latex interfaces for tables then.

Correct.  But I intend to have a look in any case.  Sweave has been 
mentioned, which do you recommend?  Are there others?

>>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.
>
>It sounds as if you are not interested in teaching students the principles 
>of reproducible research, which is too bad. [See references towards the 
>bottom of http://biostat.mc.vanderbilt.edu/StatReport].

You are jumping at conclusions.  There is after all a difference between 
"not interesting in" and "not knowing about".  That pointer was very nice 
and the page had lots of useful information.  Thank you!

>>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
>
>--
>Frank E Harrell Jr   Professor and Chair           School of Medicine
>                      Department of Biostatistics   Vanderbilt University

Tom




More information about the R-help mailing list