Learn R Programming

oeli (version 0.7.7)

find_pkg_functions: Find R functions in a package

Description

This function lists R functions found in an R package. It can inspect the loaded namespace for exported and non-exported functions and, if a package source path is available, scan .R files in R/.

Usage

find_pkg_functions(pkg, include_namespace = TRUE, include_source = TRUE)

Value

A tibble with one row per found R function and columns name, title, exported, and signature.

Arguments

pkg

[character(1)]
The name of an installed package or the path to a package source directory.

include_namespace

[logical(1)]
Include functions found in the loaded package namespace?

include_source

[logical(1)]
Include functions found by scanning .R source files?

Details

include_namespace = TRUE inspects the package namespace with asNamespace(). This works for installed packages and returns the R functions that are actually available after the package is loaded, including internal functions.

include_source = TRUE scans the package source files under R/. This is useful when pkg points to a package source directory, for example while developing a package before it is installed. If both options are TRUE, the result is combined and duplicate function names are removed.

The title column is read from Rd documentation aliases. It is NA when no matching Rd documentation entry is available for a function.

See Also

Other package helpers: Dictionary, Storage, check_missing(), find_namespace_calls(), identical_structure(), input_check_response(), match_arg(), package_logo(), print_data.frame(), print_matrix(), system_information(), unexpected_error(), user_confirm()

Examples

Run this code
if (FALSE) {
find_pkg_functions("R6")
find_pkg_functions(".")
}

Run the code above in your browser using DataLab