filter_dependencies: Filter dependencies by type

View source: R/deps-filter.R

filter_dependenciesR Documentation

Filter dependencies by type

Description

This function removes all dependencies that are not one of the specified types.

Usage

filter_dependencies(object, which = "strong")

## S3 method for class 'wood_deps'
filter_dependencies(object, which = "strong")

## S3 method for class 'wood_dep_squashed'
filter_dependencies(object, which = "strong")

## S3 method for class 'wood_dep_list'
filter_dependencies(object, which = "strong")

## S3 method for class ''NULL''
filter_dependencies(object, which = "strong")

Arguments

object

wood_deps() || wood_dep_list()
Dependencies to filter.

which

character()
A vector listing the types of dependencies, a subset of c("Depends", "Imports", "LinkingTo", "Suggests", "Enhances"). Character string "all" is shorthand for that vector, character string "most"for the same vector without "Enhances", character string "strong" (default) for the first three elements of that vector. The same convention as in tools::package_dependencies().

Value

Object of the same class as object parameter, but with filtered dependencies.

Examples

# It can filter both single-package dependencies...
stats_deps <- wood_core_dependencies("stats")
filter_dependencies(stats_deps)

# ...and a list for multiple packages too.
core_pkgs <- wood_core_packages()
core_deps <- wood_dependencies(core_pkgs, "core")
filter_dependencies(core_deps, c("Imports", "Enhances"))


ErdaradunGaztea/woodendesc documentation built on Feb. 1, 2025, 2:26 a.m.