get_packages {Nmisc} | R Documentation |
Get information about the package used in the project
Description
The function returns a data frame containing information about
packages that are loaded with library()
, require()
, used
with ::
operator, listed in the DESCRIPTION file,
and/or already loaded.
Usage
get_packages(
project_path = ".",
include_pattern = "\\.R(md)?$",
exclude_pattern = "tests/",
package_options = c("referenced", "library", "description")
)
Arguments
project_path |
A string representing the path of the project root
in which the function will look recursively in order to find files that
fit |
include_pattern |
A string representing a regex that matches
project files in which to look for packages. By default,
|
exclude_pattern |
A string representing a regex that matches
project files to exclude. By default,
|
package_options |
A character vector that represents the method through
which packages are loaded or referenced. The options are:
|
Value
A data frame containing package information:
package_name |
The name of the package |
requested_by |
The context in which the package was used |
is_base |
Whether package is part of the core R packages |
source |
The source from which the package was installed |
version |
The version of the package, if installed locally |
is_installed |
Whether the package is installed locally |
See Also
Examples
## Not run:
package_df <- get_packages(
project_path = '.',
include_pattern = '\\.R$',
exclude_pattern = '',
package_options = c('referenced'))
## End(Not run)