Skip to content

slides in linux R

5 messages · Fredrik Lundgren, Tamas Papp, Jonathan Baron +2 more

#
Hello,

In S-Plus Windows you can transform graphics to Powerpoint very easily, in R Windows you can use enhanced metafiles (.emf) and Powerpoint almost as easy. Is there a simular way with R in Linux to transform to the presentation program in StarOffice or OpenOffice or are you stuck with the pdf device?

Fredrik Lundgren
#
On Sat, Apr 05, 2003 at 09:01:49AM +0200, Fredrik Lundgren wrote:

            
I recommend using LaTeX with the prosper class and the listings
package --- this generates beautiful slides which you can show using
Acrobat reader (Ghostscript won't handle cross references) on Windows
or Unix machines. Obviously, TeX has the advantage of typesetting
formulas beautifully, as opposed to *Office. 

Hope this example code below helps you get started, however:

1. make sure that you generate PS of PDF, since DVI won't show
anything,

2. if you like this method, please read the documentation of listings
and prosper.

---- cut here ----
\documentclass[slideColor, colorBG, autumn]{prosper}

\usepackage{listings}

\begin{document}

\lstset{language=R} % you could set colors and styles here

\title{Sample R Code}

\begin{slide}{Example from \lstinline!?c!}

  \begin{lstlisting}{}
    c(1,7:9)
    c(1:5, 10.5, "next")
  
    ## append to a list:
    ll <- list(A = 1, c="C")
    ## do *not*
    c(ll, d = 1:3) # which is == c(ll, as.list(c(d=1:3))
 
    ## but rather
    c(ll, d = list(1:3))# c() combining two lists
  \end{lstlisting}
\end{slide}

\end{document}
---- cut here ----

Regards,

Tamas Papp

PS.: Please break you lines at 70 characters.
#
On 04/05/03 09:01, Fredrik Lundgren wrote:

            
This isn't really an answer.  But for an ordinary talk - without
movies or audio - I have made pdf slides with Latex, including
eps output from R, like this:

\documentclass[landscape]{slides}
\usepackage{color,graphicx}
\pagestyle{empty}
\begin{document}
\begin{slide}
...
\end{slide}
and so on.

(The "color" allows fancy ppt-like overlays, etc.)  Then, when I
format this, I do the following.  (This is the batch file I run,
so $1 stands for the name of the tex file.)

latex $1
dvips -Ppdf -T 11in,8.2in $1
ps2pdf $1.ps

Finally, when I show it, I use
xpdf -fullscreen

When I gave a local talk this way, one of my colleagues, knowing
of my antipathy toward Microsoft, said, "You've given in!"  He
thought it was PowerPoint, but actually it took about 1/10 of the
disk space that ppt would take.

I think it would be better still if I used pdflatex, but I
haven't tried that because lately I've been doing slides in html
using http://www.psych.upenn.edu/~baron/900/slides.css . (Any of
the htm files in that directory will work with it.  Some are
quite old and ugly, however.)  This uses a feature of css, namely

html, body {
  height: 100%;
  overflow: visible;
}

This does not work in most browsers but does work in Mozilla and
recent versions of Netscape.  In a way this is an advantage for
classes because the students print out the slides with IE and
don't have to waste paper with all the white space.
#
Dear R helpers,

Is there a Branch and Bound code in R? (other than the one in the leaps
package).

I really appreciate your help,

-M. Kerasha
#
On 05-Apr-03 Jonathan Baron wrote:
Tottering dinosaurs like myself will perhaps appreciate the following,
but it is also worth attention from more recently evolved individuals.

As well as LaTeX, don't forget good old Unix troff -- or, rather, its
re-incarnation as GNU groff. As well as troff's long-established
capability to import EPS files (the output format of postscript() in R), 
groff is now capable of colours and, using the \X'ps: exec <code>'
passthrough to the PS postprocessor, can incorprate "PDFmark" tags.

The resulting PS file can be converted to PDF using any good converter
(Acrobat Distiller works beautifully, of course, and recent versions
of ghostscript -- 'ps2pdf' command -- also implement PDFmarks well;
see also Frank Siegert's "PStill" program).

PDFmarks in effect convert a PDF document into a HyperText document
when viewed using Acrobat Reader (recent versions of "xpdf" also work
well), with embedded links/tags enabling you to jump from place to place
in a document, open external PDF files (and return), visit Web URLs,
flash up "comment" boxes, and all sort of other things including spawning
other programs (e.g. to show a "movie" clip).

For recent groff see any recent Linux distribution, or visit
  http://www.gnu.org/software/groff/groff.html

For PStill visit
  http://www.wizards.de/~frank/pstill.html

For various information about PDFmarks (and PDF generally) see
  http://www.pdflib.com/pdfmark/index.html
  http://www.pdflib.com/

For PDFmark reference material see
  http://partners.adobe.com/asn/developer/acrosdk/DOCS/pdfmark.pdf
  http://partners.adobe.com/asn/developer/acrosdk/DOCS/pdfspec.pdf

HTML output from groff is also available (though PDFmarks are silent
in HTML -- use other tags defined for the output format 'html').

Best wishes to all,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 167 1972
Date: 06-Apr-03                                       Time: 13:04:07
------------------------------ XFMail ------------------------------