View source: R/system_requirements.R
| pac_system_requirements | R Documentation |
Report the SystemRequirements fields declared by a package and its
dependencies. These fields are free text and can describe optional or
platform-specific requirements; this function does not check whether they
are installed or resolve dependency version constraints. It reports the
installed versions or the versions selected from the repository indexes.
pac_system_requirements(
pac,
fields = c("Depends", "Imports", "LinkingTo"),
lib.loc = .libPaths(),
local = TRUE,
recursive = TRUE,
recursive_fields = c("Depends", "Imports", "LinkingTo"),
repos = biocran_repos()
)
pac |
|
fields |
Dependency fields to follow for the requested package. In
addition to the values
described in |
lib.loc |
|
local |
Use installed packages when |
recursive |
Follow dependencies recursively. Default: |
recursive_fields |
Dependency fields to follow for indirect
dependencies. Defaults to |
repos |
Repositories to use for source packages when |
With recursive = FALSE, only the package and its direct dependencies are
considered. With recursive = TRUE, dependencies are followed recursively.
By default, Suggests and Enhances are only followed for the requested
package when included in fields; indirect dependencies use
recursive_fields.
R and its base packages are excluded from the dependencies, but the
requested package is always included.
A named list, similar to tools::package_dependencies(). Names
are package names, starting with pac, and each element is a character
vector of declared system requirements. The SystemRequirements field is
split on top-level commas and semicolons (not inside parentheses), with
whitespace normalized; fields written as sentences are kept whole.
Splitting is heuristic because the field is free text. Packages without
a declared field have
character(0). Dependencies missing from the library or repositories
have NA_character_ and produce a warning, because their own
dependencies cannot be assessed. The "versions" attribute is a named
character vector with the installed or repository versions.
Use unique(unlist(result)) to get all requirements.
By default, source repository indexes are filtered for the current
R version and platform. Bulk metadata and downloaded DESCRIPTION fields
are cached for 30 minutes. A missing SystemRequirements field does not
guarantee that a package has no system requirements. Bioconductor bulk
metadata can normalize whitespace in the declared field.
pac_system_requirements("stats", fields = character())
## Not run:
pac_system_requirements("curl", recursive = FALSE)
pac_system_requirements("sf", local = FALSE, repos = "https://cran.r-project.org")
sf <- pac_system_requirements("sf", fields = "most", local = FALSE)
sf[["sf"]]
# all requirements of sf and its dependencies
unique(unlist(sf, use.names = FALSE))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.