I am working in a computer without admin rights. The R version installed is 3.4.4. The IT administrator sees no prospect in upgrading R.
I need to install a package and its dependencies manually (I know how to do this). To download the packages and dependencies, I use the code below (borrowed from here), which works fine:
getPackages <- function(packs){
packages <- unlist(
tools::package_dependencies(packs, available.packages(), which=c("Depends", "Imports"), recursive=TRUE)
)
packages <- union(packs, packages)
packages
}
packages <- getPackages(c("gmm"))
download.packages(packages, destdir="/home/<user>/Downloads/", type="win.binary")
The only problem is that it will download the latest version of every package. Is there a way I can do the above, but specifying an R version? The package_dependencies()
function seems to contain not such option. There is a package called miniCRAN
(here) which has functions to check dependencies accepting the option of Rversion
, but only allowing for two digits (e.g. 3.1, 3.2, etc). I need the three digit one.