find_internal_symbols: Given a package namespace or an environment, find all...

View source: R/find_deps.R

find_internal_symbolsR Documentation

Given a package namespace or an environment, find all internal symbols used by each function

Description

find_internal_symbols() finds all the objects in the given package namespace (or environment), then, for each function in the environment, it finds all symbols in the function (by calling find_symbols(), and then it filters the symbols so that only symbols referring to objects in the environment/namespace remain.

find_internal_deps() does the same, and then for each function, it considers each (internal) symbol as a dependency and recursively finds all dependencies. So for a given function in the environment, find_internal_deps() finds the internal dependencies needed for that function.

Usage

find_internal_symbols(env = "staticimports")

find_internal_deps(env = "staticimports")

Arguments

env

A string naming a package, or an environment.

Value

A named list, where the name of each element is the name of each object in env, and the value is a character vector of strings, where each string is the name of an object in the environment.

Examples

# By default, find symbols internal to the staticimports package
find_internal_symbols()

# Find all symbols internal to the utils package
find_internal_symbols("utils")


wch/staticimports documentation built on Jan. 13, 2024, 8:48 p.m.