The versions of Saagie packages in the R capsule and Rstudio notebook are fixed at a specific date, and so is the CRAN mirror used by default when installing new packages. This guarantees a coherence between the 2 technologies and a compatibility between all the packages.
However, if you need a package in a specific version, here's how to do it.
The simplest way to update packages to their latest CRAN version is:
pkgs <- c("data.table", "dplyr")
for (pkg in pkgs) install.packages(pkg, repos = "https://cloud.r-project.org")
To control versions, there are different techniques (such as the renv package). Here is a lightweight alternative to use on Saagie:
options(repos = "https://cloud.r-project.org")
if (!length(find.package("remotes", quiet = TRUE))) install.packages("remotes")
versions <- c(data.table = "1.10.0", dplyr = "0.5.0")
for (pkg in names(versions))
if (!length(find.package(pkg, quiet = TRUE)) || packageVersion(pkg) != versions[pkg])