I donโt know how to knitr, but for Sweave (and base latex) there is actually a trick: ask the R-code to create a pdf file, and then use the standard \includegraphics to pull it in.
So with this:
\documentclass[twocolumn, 12pt]{article} \usepackage{graphicx} \begin{document} %\SweaveOpts{dev=pdf} <<aaa,fig=FALSE,print=FALSE,echo=FALSE>>= pdf("mychart.pdf", width=6, height=3) set.seed(42) plot(cumsum(rnorm(100)), type='l', main="yet another random walk") invisible(dev.off()) @ \begin{figure*} \includegraphics{mychart.pdf} \end{figure*} \end{document}
I got the document below (which then converted from pdf to png):

source share