Is there a way to import an entire RScript (.R) file into Latex directly without manually using listings and copying the code into Latex?
[Tex/LaTex] Importing entire R Script file into Latex
latex-baselatex-miscr
latex-baselatex-miscr
Is there a way to import an entire RScript (.R) file into Latex directly without manually using listings and copying the code into Latex?
Best Answer
foo.R:
Note: The
# ---- foo
is not only a comment. It is a must label, as is.foo.Rnw:
foo.pdf, page 1:
Note: If you have no idea of how compile this, or what the hell is
knitr
, just loadfoo.Rnw
in the Rstudio editor a push the "Compile PDF" button, and of course, search information aboutknitr
.