Restart Codespace

Currently, every free Github account has access to 120 core hours per month to run Codespaces. When you start a Codespace, by default it uses 2 cores. This means you can run a Codespace for 60 hours per month (120 core hours / 2 cores = 60 hours). For more information, visit Codespaces Billing.

After creating a Codespace, people can restart an existing Codespace. Restarting an existing Codespace is faster than creating a new Codespace. Github will delete unused Codespace, so you need to think of Codespace a temporary online workspace.

  1. Go to your Github repository.
  2. Click the “Code” green button. Click the “Codespaces” tab.

  1. a. If a Codespace exists for the repo, you should see the randomly-assigned name for your previously-created Codespace. Click on the Codespace to restart the Codespace.

    b. If there are no Codespaces for the repo, click the green “Create codespace on main” button.

  2. You will be redirected to the new Codespace in a new browser tab. This is Visual Studio Code, the default code editor for GitHub Codespace. We want to use RStudio as our code editor.

    You will see page with “Setting up remote connection: Building codespace…” message in the corner.

  3. Once the Codespace has started, there should be a “bash”, “Codespaces: timer”, and “Codespaces: rstudio-start” on the lower right. Click on the “PORTS” tab at the bottom.

  4. In the PORTS tab, hover over the item named RStudio or 8787. Click on the middle globe icon to start RStudio in a new browser tab.

  5. Now you are ready to write and run R code using RStudio.