Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Binder to run the analysis online and interactive #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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
Expand All @@ -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/).
Expand Down
3 changes: 3 additions & 0 deletions install.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
install.packages("tidyverse")
install.packages("data.table")
install.packages("r2excel")
1 change: 1 addition & 0 deletions runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
r-2018-07-02