remove.packages
Remove Installed Packages
Description
Removes the specified package(s) from the library.
Usage
remove.packages(pkgs, lib = NULL)
Arguments
pkgs |
a character vector. Specifies the name(s) of the packages to remove.
|
lib |
a character string. Specifies the location of the package(s). If it is missing
NULL, the first element of .libPaths() is used.
|
Details
If the package was loaded via a previous call to library, then the package
is currently being used until it is unloaded. You must unload a package before you can
remove it.
Value
returns invisible
NULL.
- If the package is currently in use, returns a warning.
- If the package cannot be found, returns a warning.
Warning
Use this function with caution. Removing a package deletes it from the library (by default the directory TERR_HOME/library).
Differences Between TIBCO Enterprise Runtime for R and Open-Source R
- In R, the argument lib is given without the default NULL value.
- In R, this function does not display a
warning for the packages in use. No warning is given if the specified package is
not found in the specified library.
- In R, after the specified package(s) are removed, the HTML index of
packages is updated.
See Also
Examples
install.packages("rpart")
library("rpart")
search()
# [1] ".GlobalEnv" "package:rpart" "package:stats"
# [4] "package:graphics" "package:grDevices" "package:utils"
# [7] "package:datasets" "package:methods" "package:base"
detach(2, unload = TRUE)
remove.packages("rpart")
library("rpart")
# Error in library("rpart") : there is no package called 'rpart'