I would like to use knitr
to create presentations that embed R
objects and code.
For IT reasons I am restricted to vim, so i have found the available Rstudio+knitr examples fairly unhelpful. The vim section of the knitr
documents is also very skinny, and therefore unhelpful.
Is someone able to provide some guidance on how to compile a *.Rnw
or *.Rmd
file using knitr
(or alternately point me to a decent online tutorial?) using some combination of vim
, R
, and the command line?
thanks in advance
Instead of going through Rstudio, you can use the functions in the knitr
package directly. There are some options you can tweak, but to get started, all you have to do is call the knit()
function on your .Rnw
file:
library(knitr)
knit('my_input.Rnw')
If you're missing some of Rstudio's features, it's worth remembering that most of them are just making use of things that are already available in various R packages, so you can usually find a way to use them when you don't have Rstudio available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With