Cross-references each function node's calls_list against the set of
known user-defined node identifiers. Each matched call produces one
directed edge (from_node_id -> to_node_id).
Arguments
- func_nodes
A list of node records as returned by
extract_function_nodes().
Value
A data.frame with columns:
fromCharacter:
node_idof the calling function.toCharacter:
node_idof the called function.weightNumeric: edge weight (default
1).
Zero rows if no intra-project calls are found.
Details
The matching strategy is:
Exact match on bare function name (
to_name).Qualified match: if
calls_listcontainspkg::fnorpkg:::fn, the barefnpart is matched against known node names.
Only edges between nodes present in func_nodes are returned (intra-project
edges). Calls to external packages are intentionally excluded here; use
build_import_edges() for package-level dependencies.
Examples
if (FALSE) { # \dontrun{
proj <- detect_rproject("/path/to/mypkg")
nodes <- extract_function_nodes(proj$r_files)
edges <- build_call_edges(nodes)
} # }