weightGraph | R Documentation |
Add data-driven edge and node weights to the input graph.
weightGraph(graph, data, group = NULL, method = "r2z", limit = 10000, ...)
graph |
An igraph object. |
data |
A matrix or data.frame. Rows correspond to subjects, and columns to graph nodes. |
group |
Binary vector. This vector must be as long as the number
of subjects. Each vector element must be 1 for cases and 0 for control
subjects. By default, |
method |
Edge weighting method. It can be one of the following:
|
limit |
An integer value corresponding to the number of graph
edges. Beyond this limit, multicore computation is enabled to reduce
the computational burden. By default, |
... |
Currently ignored. |
A weighted graph, as an igraph object.
Mario Grassi mario.grassi@unipv.it
Grassi M, Tarantino B (2023). [Supplementary material of] SEMtree: tree-based structure learning methods with structural equation models. Bioinformatics, 39 (6), 4829–4830 <https://doi.org/10.1093/bioinformatics/btad377>
Fisher RA (1915). Frequency Distribution of the Values of the Correlation Coefficient in Samples from an Indefinitely Large Population. Biometrika, 10(4), 507–521. <doi:10.2307/2331838>
# Graph weighting
G <- weightGraph(graph = sachs$graph,
data = log(sachs$pkc),
group = sachs$group,
method = "r2z")
# New edge attributes
head(E(G)$pv); summary(E(G)$pv)
head(E(G)$zsign); table(E(G)$zsign)
# New node attributes
head(V(G)$pv); summary(V(G)$pv)
head(V(G)$zsign); table(V(G)$zsign)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.