Skip to contents

Who calls this function?

Usage

graph_callers(graph, name)

Arguments

graph

A insider_graph from build_graph(), or a target (source directory / installed package name) to build one from.

name

Exact node name to look up.

Value

A data frame of call sites: caller, its kind, and (in source mode) the file and line of each call.

Examples

dir <- tempfile()
dir.create(dir)
writeLines("f <- function(x) g(x)\ng <- function(x) x + 1", file.path(dir, "code.R"))
g <- build_graph(dir, cache = FALSE)
graph_callers(g, "g")
#>   caller     kind   file line
#> 1      f function code.R    1