Find the paths to one or more packages.
find.package(package, lib.loc = NULL, quiet = FALSE,
verbose = getOption("verbose"))<p></p><p>path.package(package, quiet = FALSE)</p><p>packageNotFoundError(package, lib.loc, call = NULL)</p>
| Parameter | Description |
|---|---|
package |
character vector: the names of packages. |
lib.loc |
a character vector describing the location of R library trees to search through, or NULL. The default value of NULL corresponds to checking the loaded namespace, then all libraries currently known in .libPaths(). |
quiet |
logical. Should this not give warnings or an error if the package is not found? |
verbose |
a logical. If TRUE, additional diagnostics are printed, notably when a package is found more than once. |
call |
call expression. |
# NOT RUN {
try(find.package("knitr"))
## will not give an error, maybe a warning about *all* locations it is found:
find.package("kitty", quiet=TRUE, verbose=TRUE)
## Find all .libPaths() entries a package is found:
findPkgAll <- function(pkg)
unlist(lapply(.libPaths(), function(lib)
find.package(pkg, lib, quiet=TRUE, verbose=FALSE)))
findPkgAll("MASS")
findPkgAll("knitr")
# }