[R] Sweave and graphs

Duncan Murdoch murdoch.duncan at gmail.com
Tue Sep 14 19:08:47 CEST 2010

  On 14/09/2010 12:01 PM, Katie Surrence wrote:
> Hi all,
>
> Having solved my Sweave.sty question, I'd like to figure out why my pdf
> doesn't display the graph in my demo code.
>
> Here's the demo code I'm using:
>
> http://www.stat.berkeley.edu/~houston/demo.Rnw<http://www.stat.berkeley.edu/%7Ehouston/demo.Rnw>
>
> When I run Sweave within R (version 2.11) on the .Rnw it produces the
> histogram in the graphics device in R.  When I then choose pdfLaTex in
> Miktex (version 2.8) on the file demo.tex, the resulting pdf correctly
> produces the table, but not the graph.
>
> Here's the code from the .tex file that isn't working to generate the graph:
>
> \begin{figure}
>
> \begin{center}
>
> \includegraphics{demo-FigureExample}
>
> \caption{This is my histogram for the the mean of 1000 samples of 10 N(0,1)
> random
>
> variables.}
>
> \label{fig:hist}
>
> \end{center}
>
> \end{figure}
>
>

It works for me, so I'd guess it's something in your pipeline.  How are
you running Sweave?

Duncan Murdoch