Binder

What is Binder?

A Binder (also called a Binder-ready repository) is a code repository that contains at least two things:

  • Code or content that you’d like people to run. This might be a Jupyter Notebook that explains an idea, or an R script that makes a visualization.

  • Configuration files for your environment. These files are used by Binder to build the environment needed to run your code. For a list of all configuration files available, see the Configuration Files page.

  • Configuration files may be placed in the root of your repository or in a binder/ folder in the repository’s root (i.e. myproject/binder/).

A Binder repository can be built by a BinderHub, which will generate a link that you can share with others, allowing them to interact with the content in your repository.

For R

Generate a file called runtime.txt, either in the root of your project, or in a folder called binder/.

Write in the file: r-2023-10-21 – or specify the R version with r-3.6-2023-10-21.

Write a file called install.R, in binder/ or in root, and use it to write install code for your packages, e.g.:

install.packages("ggplot2")
install.packages("readxl")

Binderise your project by following the instructions via mybinder.org

For Python

Binder automatically loads Python 3.6.

Add dependencies to your binder in the requirements.txt file like this:

numpy==1.14.5
pandas==1.1.2

Binderise your project by following the instructions via mybinder.org