Skip to content
Prev 30240 / 398506 Next

slides in linux R

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.