diff --git a/README.md b/README.md index 08afd81..1833333 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ This codebook largely applies to all three files. The exception is the variables ## Calculating the Big Mac index -The code to calculate the index is provided as a [Jupyter Notebook][jupyter]. The code itself is written in R, a programming language designed for data manipulation and statistics. You can view the [notebook][notebook link] on github. +The code to calculate the index is provided as a [Jupyter Notebook][jupyter]. The code itself is written in R, a programming language designed for data manipulation and statistics. You can view the [notebook][notebook link] on github, or run it with [Binder](https://mybinder.org/v2/gh/TheEconomist/big-mac-data/master?filepath=Big%20Mac%20data%20generator.ipynb). If you want to run the notebook, you’ll need to set up a few things: @@ -141,6 +141,12 @@ Finally, our R script uses a few R packages you’ll need to install. The [tidyv > install.packages(c('tidyverse','data.table')) ``` +or + +``` +> source('install.R') +``` + You’re all set. ### Start the notebook @@ -165,6 +171,14 @@ $ R data-generator-v2.R to calculate the index files. (The R script may generate numbers that are different at the last decimal place to those from the Python notebook—these differences are due to rounding errors and can be safely ignored.) +### Run online + +The notebooks can also be run online, with no install, using [Binder](https://mybinder.org/). + +Jupyter+R: [![Binder](http://mybinder.org/badge.svg)](http://beta.mybinder.org/v2/gh/TheEconomist/big-mac-data/master) + +RStudio: [![Binder](http://mybinder.org/badge.svg)](http://beta.mybinder.org/v2/gh/TheEconomist/big-mac-data/master?urlpath=rstudio) + ### Licence This software is published by _[The Economist](https://www.economist.com)_ under the [MIT licence](https://opensource.org/licenses/MIT). The data generated by _The Economist_ are available under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/). diff --git a/install.R b/install.R new file mode 100644 index 0000000..166af26 --- /dev/null +++ b/install.R @@ -0,0 +1,3 @@ +install.packages("tidyverse") +install.packages("data.table") +install.packages("r2excel") diff --git a/runtime.txt b/runtime.txt new file mode 100644 index 0000000..95bedf0 --- /dev/null +++ b/runtime.txt @@ -0,0 +1 @@ +r-2018-07-02