
Update module names in an existing graph object
Source:R/update_graph_modules.R
update_graph_modules.RdUpdate module names in an existing graph object
Usage
update_graph_modules(
graph_obj,
modules,
old_col = NULL,
new_col = NULL,
levels = NULL,
allow_partial = TRUE
)Arguments
- graph_obj
A graph object returned by
build_graph_*().- modules
A named vector or a data frame used to rename modules. The mapping is
old_module -> new_module.- old_col
Character. Old-module column name in
moduleswhenmodulesis a data frame. DefaultNULLmeans auto-detect.- new_col
Character. New-module column name in
moduleswhenmodulesis a data frame. DefaultNULLmeans auto-detect.- levels
Character vector. Optional explicit module order. If
NULL, order by module size (descending) and place"Others"at the end.- allow_partial
Logical (default =
TRUE). IfTRUE, modules without rename rules keep original names. IfFALSE, all existing modules must be covered bymodules.