Skip to contents

Returns a securer::securer_tool() that looks up R function documentation from a set of allowed packages.

Usage

r_help_tool(
  allowed_packages = c("base", "stats", "utils", "methods", "grDevices", "graphics",
    "datasets"),
  max_lines = 100,
  max_calls = NULL
)

Arguments

allowed_packages

Character vector of packages the tool can look up documentation from. Default includes base R packages.

max_lines

Maximum lines of help text to return. Default 100.

max_calls

Maximum invocations. NULL means unlimited.

Value

A securer_tool object.

Details

The tool restricts documentation lookup to the packages specified in allowed_packages. Both topic name and package name must be provided; the package must be in the allow-list.

Help text is rendered as plain text via tools::Rd2txt() and truncated to max_lines lines.

Examples

# \donttest{
tool <- r_help_tool(
  allowed_packages = c("base", "stats", "utils"),
  max_lines = 200
)
# }