unshelf: Detach (unload) packages from the search path

Description Usage Arguments Value Examples

View source: R/exported_functions.R

Description

Packages can be detached by themselves, with their dependencies safely (i.e. as long as those dependencies are not being used by other packages), or with their dependencies unsafely (regardless of whether those dependencies are still needed). All non-default packages can be detached at once too, including Librarian itself.

Usage

1
2
3
4
5
6
7
unshelf(
  ...,
  everything = FALSE,
  also_depends = FALSE,
  safe = TRUE,
  quiet = TRUE
)

Arguments

...

(Names) Packages as bare names. For packages that come from GitHub, you can keep the username/package format, or omit the username and provide just the package name.

everything

(Logical) If TRUE, detach every non-default package including librarian. Any names in ... are ignored. The default packages can be listed with getOption("defaultPackages").

also_depends

(Logical) If TRUE, also detach the dependencies of the packages listed in .... This can be slow.

safe

(Logical) If TRUE, packages won't be detached if they are needed by other packages that are not listed in ....

quiet

(Logical) If FALSE, show a message when packages can't be detached because they are still needed by other packages.

Value

Invisibly returns a named logical vector, where the names are the packages and TRUE means that the package was successfully detached.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# These are the same:

#> unshelf(janitor, desiderata, purrr)
#> unshelf(janitor, DesiQuintans/desiderata, purrr)

# unshelf() returns invisibly; bind its output to a variable or access the .Last.value.

#> print(.Last.value)

#> desiderata    janitor      purrr 
#>       TRUE       TRUE       TRUE 

#> unshelf(everything = TRUE)
#> print(.Last.value)

#> librarian testthat
#> TRUE      TRUE

librarian documentation built on July 12, 2021, 5:07 p.m.