简体   繁体   中英

The package knitr without using Rstudio

As a beginner I do not know whether I can use the package knitr without using Rstudio and only with using open-source R (not with a special graphical user interface for R) or with using Revolution R enterprise?

I have not found any example or tutorial to use knitr in Revolution R enterprise or open-source R.

As far as I know, In Rstudio, I can create an R Sweave document and then compile Pdf for a document with Rnw extension but what should I do to make a Sweave document in Revolution R Enterprise or in open-source R.

Thanks in advance for any help

Finally, I had to make a Sweave document in Rstudio (called Latex.Rnw) and run the following commands in Revolution R Enterprize since I could not find how to make a Sweave document in Revolution R Enterprize!

library(knitr)
Myfile = system.file("Latex","Latex.Rnw", package = "knitr")
knit(Myfile,output="C:/Users/shima/Documents/R/win-library/2.14/knitr/Latex/Latex.tex")
setwd("C:/Users/shima/Documents/R/win-library/2.14/knitr/Latex")
tools::texi2pdf("C:/Users/shima/Documents/R/win-library/2.14/knitr/Latex/Latex.tex")

It was a really tedious job to compile the document from Revolution R Enterprize and I eventually gave it up.

knitr is a stand-alone R package that can be used with any version of R. To install in any version of R, just type:

install.packages("knitr")

Documentation and demos can be found at http://yihui.name/knitr/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM