Skip to content

Instantly share code, notes, and snippets.

@air-drummer
Created October 31, 2014 04:36
Show Gist options
  • Save air-drummer/05a900942f5646d0917a to your computer and use it in GitHub Desktop.
Save air-drummer/05a900942f5646d0917a to your computer and use it in GitHub Desktop.
pandoc conversion in R
#assuming we have a "example.rmd" file in our working directory
library(knitr)
knit2html("example.rmd")
# installing/loading the package:
if(!require(installr)) { install.packages("installr"); require(installr)} #load / install+load installr
# Installing pandoc
install.pandoc()
FILE <- "example"
system(paste0("pandoc -o ", FILE, ".docx ", FILE, ".md"))
#your .docx file is ready!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment