Shima
Shima

Reputation: 117

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

Upvotes: 0

Views: 533

Answers (2)

Shima
Shima

Reputation: 117

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.

Upvotes: 2

Noam Ross
Noam Ross

Reputation: 6249

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/

Upvotes: 0

Related Questions