So I am creating pdfs using Sweave that include some graphs that have a ton of points on them. I can get the pdf well enough, but it seems to have created it with a ton of l
As Gavin said, there is no need to switch to knitr
for this, though there are other advantages to do so. However, you don't even need to write your own saving and including code; Sweave can do that for you. If the initial document is:
\documentclass{article}
\usepackage[american]{babel}
\begin{document}
<<>>=
n <- 100000
DF <- data.frame(x=rnorm(n), y=rnorm(n))
@
<>=
plot(DF)
@
\end{document}
Then just by changing the arguments to the figure chunk, you can get a PNG instead of a PDF:
<>=
plot(DF)
@
In this simple example, it shrinks my final PDF from 685K to 70K.