p_unload: Unloads package(s)

Description Usage Arguments Note See Also Examples

Description

Unloads package(s) or all packages.

Usage

1
p_unload(..., negate = FALSE, char, character.only = FALSE)

Arguments

...

name of package(s) or "all" (all removes all add on packages).

negate

logical. If TRUE will unload all add on packages except those provided to p_unload.

char

Character vector containing packages to load. If you are calling p_unload from within a function (or just having difficulties calling it using a character vector input) then pass your character vector of packages to load to this parameter directly.

character.only

logical. If TRUE then p_unload will only accept a single input which is a character vector containing the names of packages to load.

Note

p_unload will not unload the base install packages that load when R boots up. See the comments in the help for detach about some issues with unloading and reloading namespaces.

See Also

detach

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
p_load(lattice)
p_loaded()
p_unload(lattice)
p_loaded()

p_load("lattice", "MASS")
p_loaded()
p_unload(all)
p_loaded() # will not work as you unloaded pacman

library(pacman)
p_load(lattice, MASS, foreign)
p_loaded()
p_unload(pacman, negate=TRUE)
p_loaded()

## End(Not run)

pacman documentation built on May 2, 2019, 1:08 p.m.