Checks whether any of packages has an exact alias matching topic.
Usage
topic_exists(topic, packages = pkg_search_attached())Arguments
- topic
A single string naming an alias, matched exactly. Use
topic_split()first if you need to handle qualified topics like"pkg::foo".- packages
A character vector of package names (and/or source package paths) to search, in order. Defaults to
pkg_search_attached(). Unavailable packages are skipped.
Examples
topic_exists("rnorm", "stats")
#> [1] TRUE
topic_exists("rnorm", c("base", "stats"))
#> [1] TRUE
topic_exists("median")
#> [1] TRUE
topic_exists("not-a-topic", "stats")
#> [1] FALSE