unshelf {librarian}R Documentation

Detach (unload) packages from the search path

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

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


# 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



[Package librarian version 1.8.1 Index]