[R] how to present a table in powerpoint?

Marc Schwartz mschwartz at medanalytics.com
Tue Apr 29 00:28:46 CEST 2003


>-----Original Message-----
>From: r-help-bounces at stat.math.ethz.ch 
>[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of 
>jonathan_li at agilent.com
>Sent: Monday, April 28, 2003 3:51 PM
>To: r-help at stat.math.ethz.ch
>Cc: jonathan_li at agilent.com
>Subject: [R] how to present a table in powerpoint?
>
>
>Hi,
>
>I have a nicely printed table of results generated by R's 
>> print(myresult)
>where myresult is a "data frame".
> 
>I am trying to put this table into a powerpoint slide for 
>presentation without re-typing and re-formating, i.e., present 
>it as it is in the R window. This saves time when there are a 
>lot of tables to be presented.
>
>I tried 
>> sink("myresult.txt")
>> print(myresult)
>> sink()
>
>resulting text file looks nice, but how can I insert it into 
>powerpoint without losing its formatting? When I think more 
>carefully about it, it seems to me that we need a way to 
>convert this text presentation into graphical presentation 
>such as postscript, then it would be easy to paste it into 
>powerpoint without losing its formatting. 
>
>I suspect that this is a problem many other may also face 
>sometimes. After doing searching in R-help archive with 
>keywords like "powerpoint", "presentation", I came up with 
>many entries about presenting graphs in powerpoint, but not 
>one about presenting tables of numbers.
>
>Your help is highly appreciated.
>Jonathan


This is less an R issue and more a fixed width font versus variable
width font issue.

The default font in PP is usually a variable width font, such as
Arial.  It makes for easier and more natural reading. As a result, an
'I' take up less width than a "W" and therefore the text cannot line
up properly from one line to another.

R's console uses a fixed width font by default so that columns of
characters (including spaces) can align vertically and give you the
nicely aligned columns of numbers, etc.

You will need to change the font in PP to a fixed width font like
Courier (or Courier New, which is the scalable TrueType Font version)
to be able to have your columns align vertically, as they do in R's
console.  Highlight the text you paste into PP and change the font to
Courier New and to a size that fits your slide appropriately.

If this is something that you do frequently, you can create a slide
template in PP that has Courier New as the default font, specifically
for use in this situation.

HTH,

Marc Schwartz



More information about the R-help mailing list