Learn R Programming

tugboat (version 0.1.4)

binderize: Prepare project for Binder

Description

The binderize() function converts an existing tugboat project into a Binder–compatible project by creating a Dockerfile that launches RStudio Server via the rocker/binder base image. Optionally, it can add a Binder launch badge to the project's README.

Usage

binderize(
  dockerfile = here::here("Dockerfile"),
  branch = "main",
  hub = "mybinder.org",
  urlpath = "rstudio",
  add_readme_badge = TRUE
)

Value

Invisibly returns NULL. Called primarily for its side effects of creating Binder-related files and optionally committing them.

Arguments

dockerfile

Path to the tugboat-generated Dockerfile.

branch

Character string specifying the Git branch, tag, or commit hash to build. Defaults to "main".

hub

The Binder hub to use. Currently only "mybinder.org" is supported.

urlpath

The URL path to open inside the Binder instance. Defaults to "rstudio", which opens an RStudio Server session.

add_readme_badge

Logical. Whether to add a Binder launch badge to the README. Defaults to TRUE.

Details

This enables one-click, cloud-based execution of your R analysis environment directly from GitHub using Binder.

Currently only GitHub repositories are supported. If add_readme_badge = TRUE, a Binder badge will be appended to the README file, linking to the live Binder instance.

See Also

  • create() — Generates a Dockerfile from an analysis directory.

  • build() — Builds the corresponding Docker image locally.

Examples

Run this code
if (FALSE) {
binderize(
  dockerfile = here::here("Dockerfile"),
  branch = "main",
  add_readme_badge = TRUE
)
}

Run the code above in your browser using DataLab