R/utils.R

Defines functions write_packages download_packages

# Thin wrapper around utils::download.packages
download_packages <- function(pkgs, destdir, available, repos, contriburl, type, quiet){
  utils::download.packages(
    pkgs = pkgs,
    destdir = destdir,
    available = available,
    repos = repos,
    contriburl = contriburl,
    type = type, 
    quiet = quiet
  )
}

# Thin wrapper around write_PACKAGES
write_packages <- function(dir, type, r_version) {
  r_version <- twodigitRversion(r_version)
  if (r_version >= "3.5.0") {
    tools::write_PACKAGES(dir = dir, type = type) 
  } else {
    if (getRversion() >= "3.5.0") {
      tools::write_PACKAGES(dir = dir, type = type, rds_compress = 2) 
    } else {
      tools::write_PACKAGES(dir = dir, type = type) 
    }
  }
}

Try the miniCRAN package in your browser

Any scripts or data that you put into this service are public.

miniCRAN documentation built on March 18, 2022, 6:29 p.m.