Skip to contents

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

Usage

filter_dependencies(object, which = "strong")

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

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

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

# S3 method for `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)
#> <dependencies>
#>   Imports:     utils
#>   Imports:     grDevices
#>   Imports:     graphics

# ...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"))
#> <woodendesc dependency list [14]>
#>  <base dependencies>
#> 
#>  <compiler dependencies>
#> 
#>  <datasets dependencies>
#> 
#>  <grDevices dependencies>
#> 
#>  <graphics dependencies>
#>   Imports:     grDevices
#> 
#>  <grid dependencies>
#>   Imports:     grDevices
#>   Imports:     utils
#> 
#>  <methods dependencies>
#>   Imports:     utils
#>   Imports:     stats
#> 
#>  <parallel dependencies>
#>   Imports:     tools
#>   Imports:     compiler
#>   Enhances:    snow
#>   Enhances:    nws
#>   Enhances:    Rmpi
#> 
#>  <splines dependencies>
#>   Imports:     graphics
#>   Imports:     stats
#> 
#>  <stats dependencies>
#>   Imports:     utils
#>   Imports:     grDevices
#>   Imports:     graphics
#> 
#>  <stats4 dependencies>
#>   Imports:     graphics
#>   Imports:     methods
#>   Imports:     stats
#> 
#>  <tcltk dependencies>
#>   Imports:     utils
#> 
#>  <tools dependencies>
#> 
#>  <utils dependencies>
#>