Try running R code in a codespace where VScode is configured for use with R.
These are example files for codespaces, but using R in Codespaces is always evolving, so files require active use ane maintenance.
Reach out to @eeholmes if you have questions.
- The rocker project provides templates and building blocks for R devcontainers.
- Michael Akridge's Open Science Codespaces project provides setups for R and R studio, Python, and more.
- NMFS Open Science Container Images. There are instructions for using these with codespaces.
These can be used to inspire your own Codespace files.
- The FIMS codespace. This is a codespace for R package development, including dependencies for building C++ code.
- The FIMS case studies codespace. This is a codespaces for using R packages and building a Quarto website.
- The ghactions4r codespace. This is a codespace for R package development, with few package dependencies and no special tooling.
Two ways:
- Click "Use this template" and "Open in a codespace" to directly use the repository in a codespace. This options works if you don't plan on saving any files.
- Click "Use this template" and "Create a new repository" to make your own repository based on r-vscode-codespaces. Then, open a codespace for the new repostory.
There are several codespace options here:
- r-quarto (default): Use a codespace with basic R and quarto set up.
- r-base: Use a codespace with basic R set up.
See creating a codespace in a repository for instructions on how to select which codespace you would like to use. In short, the "New with Options" button should be selected to specify which codespace configuration to use.
Copy over the devcontainer.json of choice into a folder named .devcontainer
within your R project's repository.