I am using R to analyse statistical data and plot histograms, scatter plots etc.
And then I have to export all plots as PDFs to manually include them in LaTeX report.
I wonder if there is any way for simplification of this process?
I would be happy to write something like:
\chapter{One}
\begin{r}
qplot(...)
\end{r}
So that the code between \begin{r} and \end{r} would generate a plot, save it somewhere as PDF and produce TeX like this:
\begin{figure}[ht!]
\includegraphics[width=1\textwidth,height=1\textheight]{/path/to/plot.pdf}
\end{figure}
What you want is
knitr.The website has lots of examples
within your document you can do something like
Or even set it up so your
syntax would work.
The pdf output of the minimal example from which the example above comes