Skip to contents

It's useful when working with a family of packages which name share a pattern.

Usage

match_packages(pattern)

Arguments

pattern

character string containing a regular expression (or character string for fixed = TRUE) to be matched in the given character vector. Coerced by as.character to a character string if possible. If a character vector of length 2 or more is supplied, the first element is used with a warning. Missing values are allowed except for regexpr, gregexpr and regexec.

Value

Character vector.

Examples

# All packages starting with tilt
match_packages("tool")
#> [1] "htmltools" "rsetools"  "codetools" "tools"