This seems like a simple problem, but I wasn't able to find a solution anywhere I looked.
I am writing a .Rnw document in R with the Knitr package, one that I intend to compile into .pdf form by the end. I want it to contain a few plots, preferably ones made with the ggplot2 package because it seems like the simplest solution. However, I cannot force R to include a plot in the final document. Instead of a graphic, the code writes "list()" in the place the plot should be at. Am I missing a package? Am I writing something wrong? Here is the relevant part of the code:
<<echo=FALSE>>=
library(ggplot2)
HDplot <- qplot(H,D)
@
\begin{figure}
\Sexpr{HDplot}
\end{figure}
(the problem isn't with the plot itself, as H and D are sets of values that can be plotted into a perfectly fine graph outside of the document)