compare_nets {SemNeT} | R Documentation |
Plots Networks for Comparison
Description
Uses qgraph
to plot networks.
Accepts any number of networks and will organize the plots
in the number of side-by-side columns using the heuristic of taking the square root of the number of
input and rounding down to the nearest integer (i.e., floor(sqrt(length(input)))
).
Examples
3 networks: 1 x 3
6 networks: 2 x 3
9 networks: 3 x 3
Usage
compare_nets(
...,
title,
config,
placement = c("match", "default"),
weighted = FALSE,
qgraph.args = list()
)
Arguments
... |
Matrices or data frames of network adjacency matrices |
title |
List. Characters denoting titles of plots |
config |
Character.
Defaults to |
placement |
Character.
How should nodes be placed when comparing groups?
Defaults to
|
weighted |
Boolean.
Should networks be plotted with weights?
Defaults to |
qgraph.args |
List.
An argument list to be passed onto |
Value
Plots networks using qgraph
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Epskamp, S., Cramer, A. O. J., Waldorp, L. J., Schmittmann, V. D., & Borsboom, D. (2012). qgraph: Network visualizations of relationships in psychometric data. Journal of Statistical Software, 48, 1-18.
Jones, P. J. (2019). networktools: Tools for Identifying Important Nodes in Networks. R package version 1.2.1.
Jones, P. J., Mair, P., & McNally, R. (2018). Visualizing psychological networks: A tutorial in R. Frontiers in Psychology, 9, 1742.
Examples
# Simulate Datasets
one <- sim.fluency(10)
two <- sim.fluency(10)
# Compute similarity matrix
cos1 <- similarity(one, method = "cosine")
cos2 <- similarity(two, method = "cosine")
# Compute networks
net1 <- TMFG(cos1)
net2 <- TMFG(cos2)
# Compare networks
compare_nets(net1, net2, title = list("One", "Two"), config = "spring")
# Change edge colors
compare_nets(net1, net2, title = list("One", "Two"),
config = "spring", qgraph.args = list(edge.color = "blue"))