From 2ea43e92f8425b09b64bc3c3fd288019fde43c73 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Tue, 30 Apr 2024 14:53:33 -0400 Subject: [PATCH 1/2] Added case-sensitivity warning --- src/apt-packages/NOTES.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/apt-packages/NOTES.md b/src/apt-packages/NOTES.md index c45a00a..d930650 100644 --- a/src/apt-packages/NOTES.md +++ b/src/apt-packages/NOTES.md @@ -14,6 +14,18 @@ The following example installs `curl` and `nano`. } ``` +### Specifiying R packages + +When installing R packages via `r-cran-`, note that R package name references must be lowercase. For example, the following example installs the {kableExtra} R package. + +```json +"features": { + "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": { + "packages": "r-cran-kableextra" + } +} +``` + ## Installation order Specify the installation order of Features @@ -31,4 +43,4 @@ The following example installs the `r-cran-curl` package after the `r-apt` Featu "overrideFeatureInstallOrder": [ "ghcr.io/rocker-org/devcontainer-features/r-apt" ] -``` +``` \ No newline at end of file From a5d26296835e976f89399c5a31c409fa7688f889 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Thu, 2 May 2024 10:23:25 -0400 Subject: [PATCH 2/2] Moved anecdote & example to `r-apt` NOTES --- src/apt-packages/NOTES.md | 12 ------------ src/r-apt/NOTES.md | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/apt-packages/NOTES.md b/src/apt-packages/NOTES.md index d930650..441e483 100644 --- a/src/apt-packages/NOTES.md +++ b/src/apt-packages/NOTES.md @@ -14,18 +14,6 @@ The following example installs `curl` and `nano`. } ``` -### Specifiying R packages - -When installing R packages via `r-cran-`, note that R package name references must be lowercase. For example, the following example installs the {kableExtra} R package. - -```json -"features": { - "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": { - "packages": "r-cran-kableextra" - } -} -``` - ## Installation order Specify the installation order of Features diff --git a/src/r-apt/NOTES.md b/src/r-apt/NOTES.md index 190cb25..d9d8024 100644 --- a/src/r-apt/NOTES.md +++ b/src/r-apt/NOTES.md @@ -29,7 +29,7 @@ apt-get -y install --no-install-recommends r-cran-dplyr Thanks to [r2u](https://eddelbuettel.github.io/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, +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](https://github.com/rocker-org/devcontainer-features/tree/main/src/r-packages)), you can use [the `ghcr.io/rocker-org/devcontainer-features/apt-packages` Feature](https://github.com/rocker-org/devcontainer-features/blob/main/src/apt-packages) to do so. @@ -48,6 +48,20 @@ to do so. `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](https://containers.dev/implementors/features/#overrideFeatureInstallOrder). +When installing R packages via `r-cran-` using the `apt-packages` Feature, R package name references must be lowercase. For example, the following snippet installs the {kableExtra} R package. + +```json +"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.