\documentclass{article}

\usepackage{tikz}
\usepackage[margin=1in]{geometry}
\pgfrealjobname{pgfSweave-example}
\title{Minimal pgfSweave Example}
\author{Cameron Bracken}    

\usepackage{/Library/Frameworks/R.framework/Resources/share/texmf/Sweave}
\begin{document}


\maketitle
This example is identical to that in the Sweave manual and is intended to 
introduce pgfSweave and highlight the basic differences.  Please refer to 
the pgfSweave vignette for more usage instructions. 

We embed parts of the examples from the \texttt{kruskal.test} help page 
into a \LaTeX{} document:

\begin{Schunk}
\begin{Sinput}
> data(airquality)
> kruskal.test(Ozone ~ Month, data = airquality)
\end{Sinput}
\end{Schunk}
which shows that the location parameter of the Ozone distribution varies 
significantly from month to month. Finally we include a boxplot of the data:


\setkeys{Gin}{width=4in} 
\begin{figure}[!ht]
\centering
%notice the new options
\beginpgfgraphicnamed{pgfSweave-example-boxplot}
\input{pgfSweave-example-boxplot.tikz}
\endpgfgraphicnamed
\caption{This is from pgfSweave. Text is typset by \LaTeX\ and so matches the
 font of the document.}
\end{figure}


\end{document}

