Codespaces

What is GitHub Codespaces?

GitHub Codespaces allows you to spin up ephemeral machines for running and developing software. It is similar to developing on your personal computer, but without the need for set up and installation. All GitHub users get 60 hours of GitHub Codespaces free of charge. To learn more see the GitHub Codespaces Documentation or for a quick overview, this NMFS R Users Group Presentation on Codespaces (NOAA sign-in required to view).

How do I use Codespaces for running or developing code?

Codespaces can be easily used from a repository on GitHub, if the specification files have already been set up. Follow the GitHub Documentation for using Codespaces from a repository.

What if there are no specification files?

If the specification files still need to be set up, there is detailed documentation for how to set up Codespaces. Below, we provide guidance for setting up codespaces for R package development.

How do I set up Codespaces for R package development?

There are many ways to configure Codespaces for R development. Some options include:

  1. Use r-vscode-codespaces to try out codespaces for R in a new project. This includes all the features needed to make it easy to edit and use R code with the VScode IDE.
  2. Lightest weight option: r-verse (follows steps in github documentation). This has R, but maybe not all the features you want to use it easily within codespaces. If the goal is just to run a few lines of R code without needing to extensively edit and test R code, this would be the best option.
  3. r-codespaces many features and uses renv, so startup takes a while. This option also takes a large amount of storage space.
  4. Get an environment with Python, R, Julia and Jupyter notebooks by following Eli Holmes’s Demo. This is a good option if you are using Jupyter notebooks or Python and Julia in addition to R.