Incrementally update the graph for changed files
Source:R/graph_index.R
update_graph_incremental.RdRe-parses only the files that have changed and merges the resulting nodes
and edges back into the existing graph, avoiding a full rebuild. PageRank
and embeddings are recomputed only for the affected portion of the graph,
making single-file updates substantially faster than build_rrlm_graph().
Arguments
- graph
An
rrlm_graph/igraphobject previously built bybuild_rrlm_graph().- changed_files
Character vector of absolute file paths that have been added, edited, or deleted since the last full build.
- embed_method
Character(1) or
NULL. Embedding method passed toembed_nodes().NULL(default) uses the method stored ingraph_attr(graph, "embed_method"), falling back to"tfidf".- verbose
Logical(1). Emit progress messages via cli. Default
FALSE.
Value
The updated rrlm_graph object. The graph retains all
original vertex / edge attributes; only nodes from changed_files
are touched.
Examples
if (FALSE) { # \dontrun{
g <- build_rrlm_graph("mypkg")
# After editing R/utils.R:
g <- update_graph_incremental(g, changed_files = "mypkg/R/utils.R")
} # }