Skip to content

Instantly share code, notes, and snippets.

@eugeneteo
Forked from cszang/build_adv-r.R
Last active August 29, 2015 14:23
Show Gist options
  • Save eugeneteo/5a86b7429a24a583d042 to your computer and use it in GitHub Desktop.
Save eugeneteo/5a86b7429a24a583d042 to your computer and use it in GitHub Desktop.
## we need the libraries bookdown, knitr, inline, markdown, pryr
system("git clone https://github.com/hadley/adv-r.git")
setwd("adv-r")
library(knitr)
embed_png <- bookdown:::embed_png
rmds <- list.files(pattern = "^.*rmd$")
sapply(rmds, function(x) knit(x))
cat("---\ntitle: Advanced R\nauthor: Hadley Wickham\nlanguage: en-US\n...\n",
file = "front_matter.txt")
## assuming we installed pandoc via cabal
pandoc <- "~/.cabal/bin/pandoc"
files <- c("front_matter.txt",
"Introduction.md",
"Data-structures.md",
"Subsetting.md",
"Vocabulary.md",
"Style.md",
"Functions.md",
"OO-essentials.md",
"Environments.md",
"Exceptions-Debugging.md",
"Functional-programming.md",
"Functions.md",
"Function-operators.md",
"Computing-on-the-language.md",
"Expressions.md",
"dsl.md",
"Performance.md",
"Profiling.md",
"memory.md",
"Rcpp.md",
"C-interface.md")
build_cmd <- paste(pandoc, "-S -o adv-r.epub", paste(files, collapse = " "))
system(build_cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment