4 min read

rversions 1.1.0 is on CRAN!

Version 1.1.0 of the rversions package has been released on CRAN! rversions queries the main R SVN repository to find the versions r-release and r-oldrel refer to, and also all previous R versions and their release dates.

Get rversions’s latest version from a safe CRAN mirror near you:

install.packages("rversions")

This release, compared to rversions 1.0.3, brings

  • ✨ caching ✨ of the R versions within each R session (less useless queries!) thanks to a contribution by Rich FitzJohn;

  • ✨ version nicknames ✨ information to the output of rversions functions;

  • a documentation website built with pkgdown;

  • and a new home for rversions’ source from METACRAN to R-hub! 🏠

That’s it, but since it’s the first time we blog about rversions, we’ll use the release as an opportunity to introduce it with all due respect! How does rversions work and what is it useful for?

Where does rversions get its information from?

As you might have guessed, R is developed under version control. The R Core team uses SVN, i.e. Apache Subversion. The versions rversions outputs are derived from SVN tags in the main R SVN repository. In SVN lingo, “tagging refers to labeling the repository at a certain point in time so that it can be easily found in the future.” so it might remind you of git tags (or of GitHub releases). In more details,

head(rversions::r_versions())
##   version                        date nickname
## 1    0.60 1997-12-04T08:47:58.000000Z     <NA>
## 2    0.61 1997-12-21T13:09:22.000000Z     <NA>
## 3  0.61.1 1998-01-10T00:31:55.000000Z     <NA>
## 4  0.61.2 1998-03-14T19:25:55.000000Z     <NA>
## 5  0.61.3 1998-05-02T07:58:17.000000Z     <NA>
## 6    0.62 1998-06-14T12:56:20.000000Z     <NA>
  • r-release is the latest SVN tag
rversions::r_release()
##     version                        date    nickname
## 112   3.5.3 2019-03-11T08:04:49.379300Z Great Truth
  • r-oldrel is the latest of the previous minor version
rversions::r_oldrel()
##     version                        date           nickname
## 108   3.4.4 2018-03-15T08:04:27.234564Z Someone to Lean On
  • r-release-tarball is the latest SVN tag that has a corresponding tar.gz to download
rversions::r_release_tarball()
##     version                        date
## 112   3.5.3 2019-03-11T08:04:49.379300Z
##                                                        URL    nickname
## 112 https://cran.r-project.org/src/base/R-3/R-3.5.3.tar.gz Great Truth
  • Windows, macOS are the same: latest SVN tag that has a file to download
rversions::r_release_win()
##     version                        date
## 112   3.5.3 2019-03-11T08:04:49.379300Z
##                                                             URL
## 112 https://cran.r-project.org/bin/windows/base/R-3.5.3-win.exe
##        nickname
## 112 Great Truth
rversions::r_release_macos()
##     version                        date
## 112   3.5.3 2019-03-11T08:04:49.379300Z
##                                                   URL    nickname
## 112 https://cran.r-project.org/bin/macosx/R-3.5.3.pkg Great Truth

Version nicknames are extracted from specific files from R 2.15.1, e.g. https://svn.r-project.org/R/tags/R-2-15-1/VERSION-NICK. Before that there were only 3 version nicknames, which we got from Lucy D’Agostino McGowan’s excellent blog post about R release names, where you can also read about their meaning.

Where is rversions used?

rversions is used in R packages but also public services for R package developers, including R-hub of course!

In R packages

  • rversions is used in devtools, in dr_devtools() to compare the installed R version to the current R release version.

  • provisionr imports rversions and uses it in check_r_version(), a function that checks and coerces something into an R version.

In other tools

In the tools mentioned below, rversions is used via its very own web service.

Can we also play with rversions data?

At this point, you have no doubt rversions is useful, but what about we use it to get a glimpse at R’s release schedule over time?

library("ggplot2")
versions <- rversions::r_versions()
versions <- dplyr::mutate(versions, date = anytime::anytime(date))
versions <- tidyr::separate(versions, version,
                            into = c("major", "minor", "patch"))
## Warning: Expected 3 pieces. Missing pieces filled with `NA` in 13 rows [1,
## 2, 6, 11, 15, 18, 20, 22, 23, 25, 27, 31, 33].
versions <- dplyr::mutate(versions, patch = ifelse(is.na(patch), 0, patch))
versions <- dplyr::mutate(versions, release = dplyr::case_when(
  major != dplyr::lag(major) ~ "major",
  minor != dplyr::lag(minor) ~ "minor",
  TRUE ~ "patch"
))

ggplot(versions) +
  geom_segment(aes(x = date, xend = date,
                 col = release), 
                   y = 0, yend = 1) +
  viridis::scale_colour_viridis(discrete = TRUE) +
  theme_minimal() +
  hrbrthemes::theme_ipsum(base_size = 16,
                          axis_title_size = 16) +
  xlab("Time") + 
  theme(
  axis.text.y = element_blank(),
  axis.ticks.y = element_blank(),
  axis.title.y = element_blank(),
  legend.position = "bottom") +
  ggtitle("R releases over time",
          subtitle = "Data obtained via the R-hub rversions R package")
Major, minor and patch releases of R over time

Figure 1 Major, minor and patch releases of R over time

With the R version being x.y.z, we define a major release as a change in x, a minor release as a change in y and a patch release as a change in z. The figure above shows that the frequency of minor releases decreased in 2013, from twice to once a year. The frequency of patch releases seems irregular, as is the frequency of major releases: not sure when we should expect R 4.0.0!

Conclusion

The best place to get to know rversions is its brand-new documentation website built with pkgdown, and the best place to provide feedback or contribute is its GitHub repo. Thanks to all folks who chimed in in the issue tracker and pull request tab!