Skip to content

Latest commit

 

History

History
129 lines (86 loc) · 5 KB

README.md

File metadata and controls

129 lines (86 loc) · 5 KB

R (via apt) (r-apt)

Installs the latest R, some R packages, and needed dependencies. Note: May require source code compilation for some R packages.

Example Usage

"features": {
    "ghcr.io/rocker-org/devcontainer-features/r-apt:0": {}
}

Options

Options Id Description Type Default Value
vscodeRSupport Install R packages to make vscode-R work. lsp means the languageserver package, full means lsp plus the httpgd package. string minimal
installDevTools Install the devtools R package. boolean false
installREnv Install the renv R package. boolean false
installRMarkdown Install the rmarkdown R package. It is required for R Markdown or Quarto documentation. boolean false
installJupyterlab Install and setup JupyterLab (via python3 -m pip). JupyterLab is a web-based interactive development environment for notebooks. boolean false
installRadian Install radian (via python3 -m pip). radian is an R console with multiline editing and rich syntax highlight. boolean false
installVscDebugger Install the vscDebugger R package from the GitHub repo. It is required for the VSCode-R-Debugger. boolean false
useTesting For Debian, install packages from Debian testing. If false, the R package installed by apt may be out of date. boolean true
installBspm Install and enable BSPM (Bridge to System Package Manager) to install R packages. This option is only working on Ubuntu now. boolean false

Customizations

VS Code Extensions

  • REditorSupport.r

Supported platforms

linux/amd64 platform debian, ubuntu:focal and ubuntu:jammy.

If the useTesting is true, linux/arm64 platform debian also supported.

Note that this Feature only supports non-R images. If R is already installed, installation will be failed.

R package installation

Binary installation via apt

This feature will configure apt to install R and R packages.

Packages that can be installed via apt can be displayed with the following command.

apt-cache search "^r-.*" | sort

For example, the following command installs the dplyr package.

apt-get -y install --no-install-recommends r-cran-dplyr

Thanks to r2u, on Ubuntu, all packages on CRAN and BioConductor can be installed via apt.

If you want to install R packages via apt during the container build phase (as opposed to installing R packages using the r-packages Feature), you can use the ghcr.io/rocker-org/devcontainer-features/apt-packages Feature to do so.

"features": {
    "ghcr.io/rocker-org/devcontainer-features/r-apt:latest": {},
    "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
        "packages": "r-cran-curl"
    }
},
"overrideFeatureInstallOrder": [
    "ghcr.io/rocker-org/devcontainer-features/r-apt"
]

ghcr.io/rocker-org/devcontainer-features/apt-packages is not guaranteed to install after this Feature, so be sure to set up the overrideFeatureInstallOrder property.

When installing R packages via r-cran-<package> using the apt-packages Feature, R package name references must be lowercase. For example, the following snippet installs the {kableExtra} R package.

"features": {
    "ghcr.io/rocker-org/devcontainer-features/r-apt:latest": {},
    "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
        "packages": "r-cran-kableextra"
    }
},
"overrideFeatureInstallOrder": [
    "ghcr.io/rocker-org/devcontainer-features/r-apt"
]

Source installation via R

Packages that cannot be installed via apt must be installed using the R functions.

For more information, please check the Rocker Project website.

Binary installation via R with bspm

If set the installBspm option to true, this Feature will install and set up the bspm R package.

bspm provides functions to manage packages via the distribution's package manager.

Known limitation: bspm does not seem to work correctly on Debian. (#169 (comment))

Python package installation

This feature has some options to install Python packages such as jupyterlab. When installing Python packages, if python3 -m pip is not available, it will install python3-pip via apt.

This feature set PIP_BREAK_SYSTEM_PACKAGES=1 when installing Python packages.

References


Note: This file was auto-generated from the devcontainer-feature.json. Add additional notes to a NOTES.md.