I'm becoming a fan of reproducible analyses and of Sweave, Beamer and specially of the knitr package.
RStudio allows to Sweave and knit documents with just one click, but although RStudio is easy to install, it is quite unstable and does not have the maturity and flexibility of the StatET plugin from Eclipse. Most tutorials or listservs tend to refer back to the RStudio IDE when asking questions about knitr and RMarkdown, but there's little out there about how to install and turn Markdown files into .Rmd
using the knitr package. Jeffrey Horner said when he announced the R markdown package that:
"Markdown documents to HTML, created in collaboration with RStudio. It offers the complete R Markdown feature set available in their best-of-breed IDE, however useRs can integrate markdown into their own toolchain of choice."
The last sentence is what I have not been able to figure out. Elsewhere, I've seen suggested to manually knitr by using library(knitr); knit('myfile.Rmd')
, however, when attempting to do this, I receive an error:
Warning in file(con, "r") :
cannot open file 'My file.Rmd': No such file or directory
Error in file(con, "r") : cannot open the connection
I was able to turn the My file.md
file into html using:
library(markdown)
markdownToHTML(file = "C:/Dropbox/eclipse/8. CM/Myfile", output="C:/Dropbox/eclipse/8. CM/Myfile.html")
However, the R code is not run, and I suspect that I need to knit the .Rmd
file first. Any help or directions about how to be able to knitr markdown files in StatET or somewhere else than Rstudio would be much appreciated.
I'm using R version 2.15.1 (2012-06-22) on a Windows 7 Professional OS. Eclipse Version: 3.8.0 and StatET 3.0.
getwd()
in R); the filemyfile.Rmd
must be under your current working directory; for the whole question, I hope StatET developers can pay attention to it; it really should not be too hard (see github.com/yihui/knitr/issues/252) – Yihui Xie