-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- | ||
title: R, CRAN, RStudio Server versions correspondance | ||
output: | ||
github_document: | ||
toc: false | ||
df_print: kable | ||
html_preview: false | ||
--- | ||
|
||
```{comment} | ||
The R code contained in this file only work on Ubuntu. | ||
``` | ||
|
||
```{r setup, include=FALSE} | ||
options(knitr.kable.NA = "") | ||
knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE) | ||
knitr::opts_knit$set(root.dir = rprojroot::find_root_file(criterion = rprojroot::is_git_root)) | ||
library(dplyr) | ||
library(tibble) | ||
library(stringr) | ||
library(purrr) | ||
library(lubridate) | ||
library(jsonlite) | ||
library(fs) | ||
library(rversions) | ||
``` | ||
|
||
In order to get coherent versioned Rocker containers, versions of R, R packages, and RStudio Server are match on a time scale by default. | ||
|
||
For information about old images with 3.X.X tags, please check [the `rocker-org/rocker-versioned` repository](https://github.com/rocker-org/rocker-versioned/blob/master/VERSIONS.md). | ||
|
||
## Rules | ||
|
||
- CRAN date is the date of the last CRAN snapshot in the era when that R version was the latest. | ||
- If that R version is the latest, the CRAN date will not be set and the latest package will always be installed. | ||
- RStudio version is the latest stable RStudio version of the era when that R version was the latest. | ||
- If a new RStudio is released when that R version is the latest, the configuration will be updated to install the new RStudio. | ||
- Ubuntu version is the latest Ubuntu LTS version when that R version was released. | ||
|
||
## Versions | ||
|
||
```{r} | ||
.read_stacks <- function(path) { | ||
jsonlite::read_json(path)$stack |> | ||
tibble::enframe(name = NULL) |> | ||
tidyr::hoist( | ||
value, | ||
image = "IMAGE", | ||
r_version = c("ENV", "R_VERSION"), | ||
cran_date = c("ENV", "CRAN"), | ||
ubuntu_series = "FROM", | ||
rstudio_version = c("ENV", "RSTUDIO_VERSION"), | ||
.transform = list( | ||
cran_date = ~ stringr::str_extract(.x, pattern = "\\d{4}-\\d{2}-\\d{2}$") |> | ||
lubridate::as_date(), | ||
ubuntu_series = ~ stringr::str_remove(.x, pattern = "^ubuntu:") | ||
) | ||
) |> | ||
tidyr::fill(rstudio_version, .direction = "up") |> | ||
dplyr::filter(image == "r-ver") |> | ||
dplyr::select( | ||
r_version, | ||
cran_date, | ||
rstudio_version, | ||
ubuntu_series | ||
) | ||
} | ||
df_stacks <- fs::dir_ls(path = "stacks", regexp = "([0-9]+\\.){3}json$") |> | ||
purrr::map_dfr(.read_stacks) | ||
df_rversions <- rversions::r_versions() |> | ||
dplyr::transmute( | ||
r_version = version, | ||
release_date = lubridate::as_date(date) | ||
) | ||
df_ubuntu <- readr::read_csv("/usr/share/distro-info/ubuntu.csv", col_select = c("version", "series")) | ||
df_stacks |> | ||
dplyr::left_join(df_rversions, by = "r_version") |> | ||
dplyr::left_join(df_ubuntu, by = c("ubuntu_series" = "series")) |> | ||
dplyr::arrange(numeric_version(r_version)) |> | ||
dplyr::select( | ||
`R version` = r_version, | ||
`Release date` = release_date, | ||
`CRAN date` = cran_date, | ||
`RStudio version` = rstudio_version, | ||
`Ubuntu version` = version | ||
) |> | ||
knitr::kable() | ||
``` | ||
|
||
Note: This table was generated from the latest definition files in the source repository, so the container images that were built and pushed may have different values set. | ||
Please check the individual reports on this wiki for the actual contents of the images. |