Search the code graph for definitions by name
Arguments
- graph
A
insider_graphfrombuild_graph(), or a target (source directory / installed package name) to build one from.- pattern
Regular expression matched against node names.
- kind
Optional filter: one or more of
"function","object","s4_class","s4_generic","s4_method","r5_class","r5_method","r6_class","r6_method".
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_search(g, "^f")
#> name kind file line_start line_end exported
#> 1 f function code.R 1 1 NA