prj_clean_deps: Uninstalls unused packages from the local project...

Description Usage Arguments Details See Also Examples

Description

Checks if all dependencies installed are required by project packages or master scripts and removes those which are not required any more.

Usage

1

Arguments

prj

project to clean dependencies of. If not passed will use the project base in the working directory. (type: rsuite_project, default: NULL)

Details

Logs all messages from the building process onto the rsuite logger. Use logging::setLevel to control logs verbosity. DEBUG level turns on building and downloading messages.

See Also

Other in project management: prj_build, prj_init, prj_install_deps, prj_load, prj_lock_env, prj_pack, prj_start_package, prj_start, prj_unload, prj_zip

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
  # create exemplary project base folder
  prj_base <- tempfile("example_")
  dir.create(prj_base, recursive = TRUE, showWarnings = FALSE)

  # start project
  prj <- prj_start("my_project", skip_rc = TRUE, path = prj_base)

  # add colorspace to master script
  master_script_fpath <- file.path(prj$path, "R", "master.R")
  write("library(colorspace)", file = master_script_fpath, append = TRUE)

  # install colorspace into project local environment
  prj_install_deps(prj = prj)

  # remove dependency to colorspace
  writeLines(head(readLines(master_script_fpath), n = -1),
             con = master_script_fpath)

  # uninstall colorspace from project local environment
  prj_clean_deps(prj = prj)

RSuite documentation built on June 10, 2019, 5:03 p.m.