[R] Getting graphs into LaTeX

Andrew Criswell arc at arcriswell.com
Sat Dec 21 05:40:04 CET 2002


Thanks to all who responded to my inquiry.  Bingo, it works!

I revised the code as follows and it works fine:

For the R code:
_______________________________________________
pdf()

pdf('lecture00-graph-01.pdf',
           horizontal = FALSE, height = 6, pointsize = 10)

hist(trial.outcome.5, breaks = 5,
     main = '1000 Replications of 5 Trials of a Coin Toss',
     xlab = 'Frequency of a Tail')

dev.off()
_______________________________________________

For the LaTeX document:
_______________________________________________

\documentclass[11pt]{article}
\usepackage[pdftex]{graphicx,color}
\begin{document}
\includegraphics{lecture00-graph-01}
\end{document}




More information about the R-help mailing list