Skip to content

Instantly share code, notes, and snippets.

@rmflight
Last active June 7, 2017 04:07
Show Gist options
  • Save rmflight/904003b7ed881c6eacbd to your computer and use it in GitHub Desktop.
Save rmflight/904003b7ed881c6eacbd to your computer and use it in GitHub Desktop.
compiling @hadley books

In the shell:

git clone https://github.com/hadley/adv-r.git
gem install jekyll mime-types

In R:

install.packages(c("rcpp", "rjsonio", "knitr", "ggplot2", "png", "lubridate", "yaml", "microbenchmark", "dplyr", "plyr", "stringr", "memoise", "inline", "fastmatch"))
devtools::install_github(c("hadley/pryr", "hadley/lineprof", "yihui/knitr", "rstudio/rmarkdown", "hadley/bookdown"))

Now back in the shell:

cd adv-r
jekyll build

This should have created a directory _site. You can now create an ebook using Calibre by adding the _site/index.html file (calibre should automatically follow all the links to the other pages in the directory) and converting it to Epub.

In the shell:

git clone https://github.com/hadley/r-pkgs.git
gem install jekyll mime-types

In R:

devtools::install_github(c("hadley/bookdown", "rstudio/rmarkdown", "hadley/bookdown", "ropensci/testdat"))
install.packages(c("rjsonio", "knitr", "png", "testthat", "nycflights13", "stringi", "lubridate", "pryr", "microbenchmark", "roxygen2"))

Now back in the shell:

cd r-pkgs
jekyll build

This should have created a directory _site. You can now create an ebook using Calibre by adding the _site/index.html file (calibre should automatically follow all the links to the other pages in the directory) and converting it to Epub.

@szebenyib
Copy link

Hi!

I have found your guidance on how to build the files, however the adv-r building process terminates because of an error (I haven't tried the other one). I do not have any experience with ruby/pandoc/jekyll unfortunately. Can you point out how to resolve the situation?

Thanks in advance.

Generating...
Error in a + b : non-numeric argument to binary operator
Error in "a" + "b" : non-numeric argument to binary operator
Error in log(x) : non-numeric argument to mathematical function
Quitting from lines 502-513 (temp.Rmd)
HiWarning messages:
1: In file(file, "rt") :
cannot open file 'code/dummy.csv': No such file or folder
2: In file(file, "rt") :
cannot open file 'code/dummy.csv': No such file or folder
Quitting from lines 153-162 (temp.Rmd)
Error in serialize(object, connection = NULL, ascii = ascii) :
argument "x" is missing, with no default
Calls: render ... system.time -> fast_function -> _digest -> serialize
Execution halted
Conversion error: There was an error converting 'Function-operators.rmd'.
jekyll 2.2.0 | Error: Knitting failed

Software is up-to-date as of today, with ubuntu 15.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment