Skip to contents

[Experimental]

This function retrieves keywords from all package documentation files located in the /man directory of the specified R package. It can return a unique list of keywords or a frequency distribution of these keywords as a table object, sorted by the keys.

Note that the "internal" keyword is ignored.

Usage

getPkgKeywords(pkg = ".", asDistribution = FALSE)

Arguments

pkg

The path to the R package directory.

asDistribution

Logical; if FALSE, returns a character vector of unique keywords. If TRUE, returns a table with the frequency of each keyword.

Value

If asDistribution is FALSE, a sorted character vector of unique keywords is returned. If asDistribution is TRUE, a table of keywords and their frequencies is returned. If no keywords were detected, returns a character of length 0.

Examples

getPkgKeywords()
#> Warning: no `/man` folder detected - ensure the package path is correct
#> character(0)
getPkgKeywords(asDistribution = TRUE)
#> Warning: no `/man` folder detected - ensure the package path is correct
#> character(0)