Compute test coverage for an R package using covr::package_coverage().
Returns either a file-level summary for the entire package or line-level
details for a specific file.
btw_tool_pkg_coverage(pkg = ".", filename = NULL, `_intent` = "")A data frame with different structures depending on filename:
When filename = NULL: Returns file-level summary with columns
filename and coverage (percentage).
When filename is specified: Returns line-level details with columns
filename, functions, line_start, line_end, is_covered, and
med_hits.
Path to package directory. Defaults to ".". Must be within
current working directory.
Optional filename to filter coverage results. If NULL
(default), returns file-level summary for entire package. If provided,
returns line-level results for the specified file.
An optional string describing the intent of the tool use. When the tool is used by an LLM, the model will use this argument to explain why it called the tool.
btw_tools()
Other pkg tools:
btw_tool_pkg_check(),
btw_tool_pkg_document(),
btw_tool_pkg_load_all(),
btw_tool_pkg_test()