I use R to analyze statistics and plot histograms, scatterplots, etc.
And then I need to export all the graphs in PDF format to manually include them in the LaTeX report.
I wonder if there is a way to simplify this process?
I would be happy to write something like:
\chapter{One} \begin{r} qplot(...) \end{r}
In order for the code between \begin{r} and \end{r} generate a graph, save it somewhere in PDF format and create TeX as follows:
\begin{figure}[ht!] \includegraphics[width=1\textwidth,height=1\textheight]{/path/to/plot.pdf} \end{figure}
source share