Skip to contents

Show one definition with its source and line numbers

Usage

graph_node(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 insider_node object; printing it shows the definition's location and line-numbered source.

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_node(g, "g")
#> 
#> ── g ───────────────────────────────────────────────────────────────────────────
#> Kind: function
#> Location: code.R:2-2
#> 2 | g <- function(x) x + 1