subgraphs: Extract Specific Motif Instances (Subgraphs)

View source: R/motifs-api.R

subgraphsR Documentation

Extract Specific Motif Instances (Subgraphs)

Description

Convenience wrapper for motifs(x, named_nodes = TRUE, ...). Returns one row per concrete node-triple instantiating each MAN pattern, so the same MAN type can appear in many rows with its own z / p per triple. For per-triple significance use plot(., type = "significance") or plot(., type = "triads"); the per-type plots ("types", "patterns") deliberately drop the significance decoration here, because aggregating per type requires a rule (median? max-|z|?) that isn't pinned and would be misleading by default.

Usage

subgraphs(...)

Arguments

...

Arguments forwarded to motifs(). See ?motifs for the full parameter list (x, actor, window, pattern, include, exclude, significance, n_perm, min_count, edge_method, edge_threshold, min_transitions, top, seed).

Value

A cograph_motif_result object with named_nodes = TRUE. Contains $results (data frame with columns triad, type, observed, and optionally z, p, sig), $type_summary, $level, $n_units, and $params. In instance mode, $type_summary is built via table(results$type) so it counts how many node-triples fall under each MAN type.

See Also

motifs()

Other motifs: extract_motifs(), extract_triads(), get_edge_list(), motif_census(), motifs(), plot.cograph_motif_analysis(), plot.cograph_motifs(), triad_census()

Examples

mat <- matrix(c(0,3,2,0, 0,0,5,1, 0,0,0,4, 2,0,0,0), 4, 4, byrow = TRUE)
rownames(mat) <- colnames(mat) <- c("Plan","Execute","Monitor","Adapt")
subgraphs(mat, significance = FALSE)

cograph documentation built on May 31, 2026, 5:06 p.m.