Package ‘NetworkToolbox’
Package ‘NetworkToolbox’
1
2 R topics documented:
R topics documented:
NetworkToolbox-package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
adapt.a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
behavOpen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
betweenness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
binarize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
closeness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
clustcoeff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
comcat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
comm.close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
comm.eigen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
comm.str . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
conn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
convert2igraph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
convertConnBrainMat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
cor2cov . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
core.items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
cpm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
dCor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
dCor.parallel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
degree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
depend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
depna . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
desc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
desc.all . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
diversity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
ECO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
ECOplusMaST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
edgerep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
eigenvector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
flow.frac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
gain.functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
hybrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
impact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
is.graphical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
kld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
lattnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
leverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
LoGo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
louvain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
MaST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
MFCF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
neoOpen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
net.coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
network.coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
NetworkToolbox-package 3
network.permutation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
neuralnetfilter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
openness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
participation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
pathlengths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
plot.cpm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
randnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
reg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
resp.rep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
rmse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
rspbc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
sim.chordal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
sim.swn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
smallworldness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
stable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
strength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
threshold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
TMFG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
transitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
un.direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Index 74
NetworkToolbox-package
NetworkToolbox–package
Description
Implements network analysis and graph theory measures used in neuroscience, cognitive science,
and psychology. Methods include various filtering methods and approaches such as threshold, de-
pendency, Information Filtering Networks, and Efficiency-Cost Optimization. Brain methods in-
clude the recently developed Connectome Predictive Modeling. Also implements several network
measures including local network characteristics (e.g., centrality), global network characteristics
(e.g., clustering coefficient), and various other measures associated with the reliability and repro-
ducibility of network analysis.
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Christensen, A. P. (in press). NetworkToolbox: Methods and measures for brain, cognitive, and
psychometric network analysis in R. The R Journal, 10, 422-439.
4 adapt.a
Description
Compute an alpha value adjusted for sample size. The adjusted value is based on Perez and Per-
icchi’s (2014) formula (equation 11, see below) using a reference sample, which can be defined a
priori or estimated using the sample size calculation from power.
p
α ∗ n0 × (log(n0 ) + χ2α (1))
p
n∗ × (log(n∗ ) + χ2α (1))
Usage
adapt.a(
test = c("anova", "chisq", "cor", "one.sample", "two.sample", "paired"),
ref.n = NULL,
n = NULL,
alpha = 0.05,
power = 0.8,
efxize = c("small", "medium", "large"),
groups = NULL,
df = NULL
)
Arguments
test Type of statistical test being used. Can be any of the tests listed
ref.n n0 in the above equation. Reference sample size. If sample size was determined
a priori, then the reference number of participants can be set. This removes the
calculation of sample size based on power
n n* in the above equation. Number of participants in the experiment sample (or
per group)
alpha α in the above equation. Alpha value to adjust. Defaults to .05
power Power (1 − β) value. Used to estimate the reference sample size (n0). Defaults
to .80
efxize Effect size to be used to estimate the reference sample size. Effect sizes are
based on Cohen (1992). Numeric values can be used. Defaults to "medium"
groups Number of groups (only for test = "anova")
df Number of degrees of freedom (only for test = "chisq")
adapt.a 5
Value
Author(s)
References
Examples
#ANOVA
adapt.anova <- adapt.a(test = "anova", n = 200, alpha = .05, power = .80, groups = 3)
#Chi-square
adapt.chisq <- adapt.a(test = "chisq", n = 200, alpha = .05, power = .80, df = 3)
#Correlation
adapt.cor <- adapt.a(test = "cor", n = 200, alpha = .05, power = .80)
#One-sample t-test
adapt.one <- adapt.a(test = "one.sample", n = 200, alpha = .05, power = .80)
#Two-sample t-test
adapt.two <- adapt.a(test = "two.sample", n = 200, alpha = .05, power = .80)
Description
NEO-PI-3 Openness to Experience associated with resting-state data (n = 144).
Usage
data(behavOpen)
Format
behavOpen (vector, length = 144)
Details
Behavioral data of NEO-PI-3 associated with each connectivity matrix (open).
To access the resting-state brain data, please go to https://drive.google.com/file/d/1ugwi7nRrlHQYuGPzEB4wYzsizFr
view
References
Beaty, R. E., Chen, Q., Christensen, A. P., Qiu, J., Silvia, P. J., & Schacter, D. L. (2018). Brain
networks of the imaginative mind: Dynamic functional connectivity of default and cognitive control
networks relates to Openness to Experience. Human Brain Mapping, 39, 811-821.
Beaty, R. E., Kenett, Y. N., Christensen, A. P., Rosenberg, M. D., Benedek, M., Chen, Q., ... & Sil-
via, P. J. (2018). Robust prediction of individual creative ability from brain functional connectivity.
Proceedings of the National Academy of Sciences, 201713532.
Examples
data("behavOpen")
Description
Computes betweenness centrality of each node in a network
Usage
betweenness(A, weighted = TRUE)
binarize 7
Arguments
A An adjacency matrix of network data
weighted Is the network weighted? Defaults to TRUE. Set to FALSE for unweighted mea-
sure of betweenness centrality
Value
A vector of betweenness centrality values for each node in the network
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses and
interpretations. NeuroImage, 52, 1059-1069.
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
#Weighted BC
BCw <- betweenness(A)
#Unweighted BC
BC <- betweenness(A, weighted = FALSE)
Description
Converts weighted adjacency matrix to a binarized adjacency matrix
Usage
binarize(A)
Arguments
A An adjacency matrix of network data (or an array of matrices)
Value
Returns an adjacency matrix of 1’s and 0’s
8 closeness
Author(s)
Examples
Description
Usage
Arguments
Value
Author(s)
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses and
interpretations. NeuroImage, 52, 1059-1069.
clustcoeff 9
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
#Weighted LC
LC <- closeness(A)
#Unweighted LC
LC <- closeness(A, weighted = FALSE)
Description
Computes global clustering coefficient (CC) and local clustering coefficient (CCi)
Usage
clustcoeff(A, weighted = FALSE)
Arguments
A An adjacency matrix of network data
weighted Is the network weighted? Defaults to FALSE. Set to TRUE for weighted measures
of CC and CCi
Value
Returns a list containing:
CC Global clustering coefficient. The average clustering coefficient for each node
in the network
CCi Local clustering coefficient. The clustering coefficient for each node in the net-
work
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses and
interpretations. NeuroImage, 52, 1059-1069.
10 comcat
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
#Unweighted CC
CCu <- clustcoeff(A)
#Weighted CC
CCw <- clustcoeff(A, weighted=TRUE)
Description
Computes the between-community strength for each node in the network
Usage
comcat(
A,
comm = c("walktrap", "louvain"),
cent = c("strength", "degree"),
absolute = TRUE,
metric = c("across", "each"),
diagonal = 0,
...
)
Arguments
A An adjacency matrix of network data
comm Can be a vector of community assignments or community detection algorithms
("walktrap" or "louvain") can be used to determine the number of factors.
Defaults to "walktrap". Set to "louvain" for louvain community detection
cent Centrality measure to be used. Defaults to "strength".
absolute Should network use absolute weights? Defaults to TRUE. Set to FALSE for signed
weights
metric Whether the metric should be compute for across all of the communities (a sin-
gle value) or for each community (a value for each community). Defaults to
"across". Set to "each" for values for each community
diagonal Sets the diagonal values of the A input. Defaults to 0
... Additional arguments for cluster_walktrap and louvain community detec-
tion algorithms
comm.close 11
Value
A vector containing the between-community strength value for each node
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Blanken, T. F., Deserno, M. K., Dalege, J., Borsboom, D., Blanken, P., Kerkhof, G. A., & Cramer,
A. O. (2018). The role of stabilizing and communicating symptoms given overlapping communities
in psychopathology networks. Scientific Reports, 8, 5854.
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
Description
Computes the community closeness centrality measure of each community in a network
Usage
comm.close(A, comm, weighted = FALSE)
Arguments
A An adjacency matrix of network data
comm A vector or matrix corresponding to the community each node belongs to
weighted Is the network weighted? Defaults to FALSE. Set to TRUE for weighted measures
Value
A vector of community closeness centrality values for each specified community in the network
(larger values suggest more central positioning)
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
12 comm.eigen
References
Christensen, A. P. (in press). NetworkToolbox: Methods and measures for brain, cognitive, and
psychometric network analysis in R. The R Journal, 10, 422-439.
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
#Weighted
result <- comm.close(A, comm)
#Unweighted
result <- comm.close(A, comm, weighted = FALSE)
Description
Computes the flow.frac for each community in the network. The values are equivalent to the com-
munity’s eigenvector centrality
Usage
comm.eigen(A, comm, weighted = TRUE)
Arguments
A An adjacency matrix
comm A vector or matrix corresponding to the community each node belongs to
weighted Is the network weighted? Defaults to TRUE. Set to FALSE for weighted measures
Value
A vector of community eigenvector centrality values for each specified community in the network
(larger values suggest more central positioning)
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Giscard, P. L., & Wilson, R. C. (2018). A centrality measure for cycles and subgraphs II. Applied
Network Science, 3, 9.
comm.str 13
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
Description
Usage
Arguments
Value
A vector of community strength/degree centrality values for each specified community in the net-
work (larger values suggest more central positioning)
Author(s)
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
#Strength
within.ns <- comm.str(A, comm, measure = "within")
between.ns <- comm.str(A, comm, measure = "between")
#Degree
within.deg <- comm.str(A, comm, weighted = FALSE, measure = "within")
between.deg <- comm.str(A, comm, weighted = FALSE, measure = "between")
Description
Computes the average and standard deviation of the weights in the network
Usage
conn(A)
Arguments
A An adjacency matrix of a network
Value
Returns a list containing:
weights Each edge weight in the network
mean The mean of the edge weights in the network
sd The standard deviation of the edge weights in the network
total The sum total of the edge weights in the network
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
Description
Converts single or multiple networks into igraph’s format for network analysis
Usage
Arguments
Value
Returns a network matrix in igraph’s format or returns a list of brain connectivity matrices each of
which have been convert to igraph’s format
Author(s)
Examples
## Not run:
neuralarray <- convertConnBrainMat()
## End(Not run)
16 convertConnBrainMat
Description
Usage
Arguments
MatlabData Input for Matlab data file. Defaults to interactive file choice
progBar Should progress bar be displayed? Defaults to TRUE. Set FALSE for no progress
bar
Value
Author(s)
Examples
## Not run:
neuralarray <- convertConnBrainMat()
## End(Not run)
cor2cov 17
Description
Converts a correlation matrix to a covariance matrix
Usage
cor2cov(cormat, data)
Arguments
cormat A correlation matrix
data The dataset the correlation matrix is from
Value
Returns a covariance matrix
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
Examples
cormat <- cor(neoOpen)
Description
Automatically determines core, intermediary, and peripheral items in the network. The entire net-
work or within-community gradations can be determined. Based on the hybrid centrality
Usage
core.items(A, comm, by = c("network", "communities"))
18 cpm
Arguments
A An adjacency matrix of network data
comm A vector or matrix corresponding to the community each node belongs to
by Should the core items be defined by network or communities? Defaults to
"network". Set to "communities" to define core items within communities
Value
Returns a list containing:
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
Examples
#network
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
#theoretical factors
comm <- c(rep(1,8),rep(2,8),rep(3,8),rep(4,8),rep(5,8),rep(6,8))
Description
Suite of functions for Connectome-based Predictive Modeling (CPM). See and cite Finn et al.,
2015; Rosenberg et al., 2016; Shen et al., 2017
• cpmIV
Internal Validation method (Rosenberg et al., 2016; Shen et al., 2017). Using a leave-one-out
approach, this method correlates a behavioral statistic bstat with each edge of a whole-brain
network across participants. Using the significant edges in the network thresh, a connec-
tome model is built (without the participant’s network). A linear regression model is fit, with
cpm 19
the behavioral statistic being regressed on the connectome model. The left out participants
connectome model is then used with the linear regression weights to compute their predicted
behavioral score. This is repeated for every participant. The predicted scores are correlated
with their observed score. Significant values suggest that the connectome is related to the
behavioral statistic
• cpmIVperm
Performs a permutation test of the results obtained by cpmIV. The permutation test quantifies
whether the results obtained by the original cpmIV are significantly different than a random
model (see Shen et al., 2017)
• cpmEV
UNDER DEVELOPMENT. External Validation method (Beaty et al., 2018). Performs similar
function as cpmIV but uses data to train train_na the connectome model using a behavioral
statistic train_b. This training connectome model is then used to predict another dataset
valid_na, using the same behavioral statistic valid_b. The full training dataset FALSE or the
leave-one-out overlap = TRUE approach can be used
• cpmFP
Fingerprinting method (Finn et al., 2015). Uses CPM approach to identify participants across
two sessions
• cpmFPperm
Fingerprinting method (Finn et al., 2015). Uses permutation method to estimate the signifi-
cance of of the cpmFP results
• cpmPlot
Plots the CPM results
Usage
cpmIV(neuralarray, bstat, kfolds, covar, thresh = .01,
connections = c("separate", "overall"), groups = NULL,
method = c("mean", "sum"), model = c("linear","quadratic","cubic"),
corr = c("pearson","spearman"), nEdges,
standardize = FALSE, cores, progBar = TRUE, plots = TRUE)
Arguments
neuralarray Array from convertConnBrainMat function
20 cpm
bstat Behavioral statistic for each participant with neural data (a vector)
kfolds Numeric. Number of k-fold validation samples. Defaults to the number of par-
ticipants in the sample (i.e., n), which is also known as leave-one-out validation.
Recommended folds are 5 and 10
covar Covariates to be included in predicting relevant edges (time consuming). Must
be input as a list() (see examples)
thresh Sets an α threshold for edge weights to be retained. Defaults to .01
connections Character. Should positive and negative correlations be separated or used to-
gether? Defaults to "separate"
groups Allows grouping variables to be used for plotting points. Must be a vector.
Defaults to NULL
method Use "mean" or "sum" of edge strengths in the positive and negative connec-
tomes. Defaults to "mean"
model Regression model to use for fitting the data. Defaults to "linear"
corr Correlation method for assessing the relationship between the behavioral mea-
sure and edges between ROIs. Defaults to "pearson". Set to "spearman" for
non-linear or monotonic associations
nEdges Number of participants that are required to have an edge to appear in the plots.
Defaults to 10 percent of edges in participants
standardize Should the behavioral statistic (bstat) be standardized? Defaults to FALSE
cores Number of computer processing cores to use when performing covariate analy-
ses. Defaults to n - 1 total number of cores. Set to any number between 1 and
maximum amount of cores on your computer
progBar Should progress bar be displayed? Defaults to TRUE. Set to FALSE for no progress
bar
plots Should plots be plotted? Defaults to TRUE. Set to FALSE to hide plots
train_na Training dataset (an array from convertConnBrainMat function)
train_b Behavioral statistic for each participant for the training neural data (a vector)
valid_na Validation dataset (an array from convertConnBrainMat function)
valid_b Behavioral statistic for each participant for the validation neural data (a vector)
overlap Should leave-one-out cross-validation be used? Defaults to FALSE (use full
dataset, no leave-one-out). Set to TRUE to select edges that appear in every leave-
one-out cross-validation network (time consuming)
session1 Array from convertConnBrainMat function (first session)
session2 Array from convertConnBrainMat function (second session)
iter Number of iterations to perform. Defaults to 1000
cpm.obj cpm object
visual.nets Boolean. Uses qgraph to plot connectivity between the networks as a network.
Defaults to FALSE. Set to TRUE to visualize the networks
... Additional arguments to be passed from a cpm function
cpm 21
Value
cpmIV and cpmEV:
Returns a list containing:
results A matrix containing: r coefficient (r), p-value (p-value), mean absolute error
(mae), root mean square error (rmse)
posMask Positive connectivity for input in BioImage Suite Connectivity Viewer
negMask Negative connectivity for input in BioImage Suite Connectivity Viewer
cpmIVperm:
Returns a matrix containing p-values for positive and negative prediction models
cpmFP:
Returns a matrix containing the percentage and number of correctly identified subjects for sessions
1 and 2
cpmPlot:
Returns plot of connectivity differences between the positive and negative masks
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Beaty, R. E., Kenett, Y. N., Christensen, A. P., Rosenberg, M. D., Benedek, M., Chen, Q., Fink, A.,
Qiu, J., Kwapil, T. R., Kane, M. J., & Silvia, P. J. (2018). Robust prediction of individual creative
ability from brain functional connectivity. Proceedings of the National Academy of Sciences, 115,
1087-1092.
Finn, E. S., Shen, X., Scheinost, D., Rosenberg, M. D., Huang, J., Chun, M. M., Papademetris,
X., Constable, R. T. (2015). Functional connectome fingerprinting: Identifying individuals using
patterns of brain connectivity. Nature Neuroscience, 18, 1664-1671.
Rosenberg, M. D., Finn, E. S., Scheinost, D., Papademetris, X., Shen, X., Constable, R. T., Chun,
M. M. (2016). A neuromarker of sustained attention from whole-brain functional connectivity.
Nature Neuroscience, 19, 165-171.
Shen, X. Finn, E. S., Scheinost, D., Rosenberg, M. D., Chun, M. M., Papademetris, X., Constable,
R. T. (2017). Using connectome-based predictive modeling to predict individual behavior from
brain connectivity. Nature Protocols, 12, 506-518.
Wei, T. & Simko, V.(2017). R package "corrplot": Visualization of a correlation matrix (Version
0.84).
Examples
# Load data
behav <- behavOpen
## Not run:
22 dCor
# Run cpmIV
res <- cpmIV(neuralarray = restOpen, bstat = behav, cores = 4)
## End(Not run)
Description
Computes the distance correlation (Yoo et al., 2019) for ROI time series data. This function is
mainly a subroutine for the dCor.parallel function
Usage
dCor(neurallist, centering = c("U", "double"))
Arguments
neurallist List. A time series list from convertConnBrainMat function
centering Character. Options for centering the Euclidean distances.
• "U" Uses number of time points minus 2 in the computation of the mean
• "double" Uses the mean
Value
Returns a m x m matrix corresponding to distance correlations between ROIs
dCor.parallel 23
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Yoo, K., Rosenberg, M. D., Noble, S., Scheinost, D., Constable, R. T., & Chun, M. M. (2019). Mul-
tivariate approaches improve the reliability and validity of functional connectivity and prediction of
individual behaviors. NeuroImage, 197, 212-223.
Examples
## Not run:
# Import time series data
neurallist <- convertConnBrainMat()
## End(Not run)
Description
Parallelizes the dCor function for faster computation times
Usage
dCor.parallel(neurallist, cores)
Arguments
neurallist List of lists. A list containing the time series list from all participants imported
from the convertConnBrainMat function
cores Number of computer processing cores to use when performing covariate analy-
ses. Defaults to n - 1 total number of cores. Set to any number between 1 and
maximum amount of cores on your computer
Value
Returns a m x m x n array corresponding to distance correlations between ROIs (m x m matrix) for
n participants
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
24 degree
References
Yoo, K., Rosenberg, M. D., Noble, S., Scheinost, D., Constable, R. T., & Chun, M. M. (2019). Mul-
tivariate approaches improve the reliability and validity of functional connectivity and prediction of
individual behaviors. NeuroImage, 197, 212-223.
Examples
## Not run:
# Import time series data
for(i in 1:5)
## End(Not run)
degree Degree
Description
Computes degree of each node in a network
Usage
degree(A)
Arguments
A An adjacency matrix of network data
Value
A vector of degree values for each node in the network.
If directed network, returns a list containing:
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
depend 25
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses and
interpretations. NeuroImage, 52, 1059-1069.
Examples
#Undirected network
## Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
#Directed network
## Not run:
dep <- depend(neoOpen)
## End(Not run)
Description
Generates a dependency matrix of the data (index argument is still in testing phase)
Usage
depend(
data,
normal = FALSE,
na.data = c("pairwise", "listwise", "fiml", "none"),
index = FALSE,
fisher = FALSE,
progBar = TRUE
)
Arguments
data A set of data
normal Should data be transformed to a normal distribution? Defaults to FALSE. Data is
not transformed to be normal. Set to TRUE if data should be transformed to be
normal (computes correlations using the cor_auto function)
26 depna
na.data How should missing data be handled? For "listwise" deletion the na.omit
function is applied. Set to "fiml" for Full Information Maximum Likelihood
(corFiml). Full Information Maximum Likelihood is recommended but time
consuming
index Should correlation with the latent variable (i.e., weighted average of all vari-
ables) be removed? Defaults to FALSE. Set to TRUE to remove common latent
factor
fisher Should Fisher’s Z-test be used to keep significantly higher influences (index
only)? Defaults to FALSE. Set to TRUE to remove non-significant influences
progBar Should progress bar be displayed? Defaults to TRUE. Set to FALSE for no progress
bar
Value
Returns an adjacency matrix of dependencies
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Kenett, D. Y., Tumminello, M., Madi, A., Gur-Gershgoren, G., Mantegna, R. N., & Ben-Jacob, E.
(2010). Dominating clasp of the financial sector revealed by partial correlation analysis of the stock
market. PLoS one, 5, e15032.
Kenett, D. Y., Huang, X., Vodenska, I., Havlin, S., & Stanley, H. E. (2015). Partial correlation
analysis: Applications for financial markets. Quantitative Finance, 15, 569-578.
Examples
## Not run:
D <- depend(neoOpen)
## End(Not run)
Description
Applies the dependency network approach to neural network array
Usage
depna(neuralarray, cores, ...)
desc 27
Arguments
neuralarray Array from convertConnBrainMat function
cores Numeric. Number of cores to use in computing results. Set to 1 to not use
parallel computing. Recommended to use maximum number of cores minus
one
... Additional arguments from depend function
Value
Returns an array of n x n x m dependency matrices
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Jacob, Y., Winetraub, Y., Raz, G., Ben-Simon, E., Okon-Singer, H., Rosenberg-Katz, K., ... &
Ben-Jacob, E. (2016). Dependency Network Analysis (DEPNA) reveals context related influence
of brain network nodes. Scientific Reports, 6, 27444.
Kenett, D. Y., Tumminello, M., Madi, A., Gur-Gershgoren, G., Mantegna, R. N., & Ben-Jacob, E.
(2010). Dominating clasp of the financial sector revealed by partial correlation analysis of the stock
market. PLoS one, 5, e15032.
Examples
## Not run:
neuralarray <- convertConnBrainMat()
## End(Not run)
Description
Computes mean, standard deviation (sd), minimum value (min), maximum value (max), and uni-
variate normal statistics (normal?) for a variable
Usage
desc(data, column, histplot = TRUE)
28 desc.all
Arguments
data A matrix or data frame
column Column name or number in data
histplot A histogram plot of the variable
Value
A data frame containing values for n (number of cases), missing (number of missing cases), mean,
sd, min, and max. normal? will contain yes/no for whether the variable is normally distributed
based on the shapiro.test for a variable
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
Examples
desc(neoOpen,1)
Description
Computes mean, standard deviation (sd), minimum value (min), maximum value (max), and uni-
variate normal statistics (normal?) for the entire dataset
Usage
desc.all(data)
Arguments
data A matrix or data frame
Value
A data frame containing values for n (number of cases), missing (number of missing cases), mean,
sd, min, and max. normal? will contain yes/no for whether the variable is normally distributed
based on the shapiro.test for the entire dataset
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
distance 29
Examples
desc.all(neoOpen)
distance Distance
Description
Computes distance matrix of the network
Usage
distance(A, weighted = FALSE)
Arguments
A An adjacency matrix of network data
weighted Is the network weighted? Defaults to FALSE. Set to TRUE for weighted measure
of distance
Value
A distance matrix of the network
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses and
interpretations. NeuroImage, 52, 1059-1069.
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
#Unweighted
Du <- distance(A)
#Weighted
Dw <- distance(A, weighted = TRUE)
30 diversity
Description
Computes the diversity coefficient for each node. The diversity coefficient measures a node’s con-
nections to communitites outside of its own community. Nodes that have many connections to other
communities will have higher diversity coefficient values. Positive and negative signed weights for
diversity coefficients are computed separately.
Usage
Arguments
Details
Values closer to 1 suggest greater between-community connectivity and values closer to 0 suggest
greater within-community connectivity
Value
Author(s)
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses and
interpretations. NeuroImage, 52, 1059-1069.
ECO 31
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
#theoretical communities
comm <- rep(1:8, each = 6)
#walktrap communities
wdiv <- diversity(A, comm = "walktrap")
Description
Applies the ECO neural network filtering method
Usage
ECO(data, directed = FALSE)
Arguments
data Can be a dataset or a correlation matrix
directed Is the network directed? Defaults to FALSE. Set TRUE if the network is directed
Value
A sparse association matrix
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Fallani, F. D. V., Latora, V., & Chavez, M. (2017). A topological criterion for filtering information
in complex brain networks. PLoS Computational Biology, 13, e1005305.
Examples
eco.net <- ECO(neoOpen)
32 edgerep
Description
Applies the ECO neural network filtering method combined with the MaST filtering method
Usage
ECOplusMaST(data)
Arguments
data Can be a dataset or a correlation matrix
Value
A sparse association matrix
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Fallani, F. D. V., Latora, V., & Chavez, M. (2017). A topological criterion for filtering information
in complex brain networks. PLoS Computational Biology, 13, e1005305.
Examples
# half the variables for CRAN checks
ECOplusMaST.net <- ECOplusMaST(neoOpen[,c(1:24)])
Description
Computes the number of edges that replicate between two cross-sectional networks
Usage
edgerep(A, B, corr = c("pearson", "spearman", "kendall"))
edgerep 33
Arguments
Value
replicatedEdges
The edges that replicated and their weights
replicated Number of edges that replicated
meanDiff The average edge weight difference between the edges that replicated
sdDiff The standard deviation edge weight difference between the edges that replicated
cor The correlation between the edges that replicated
Author(s)
Examples
Description
Usage
Arguments
Value
Author(s)
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses and
interpretations. NeuroImage, 52, 1059-1069.
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
#Weighted
EC <- eigenvector(A)
#Unweighted
EC <- eigenvector(A, weighted = FALSE)
flow.frac 35
Description
Computes eigenvector centrality over nodes in a subset of nodes in the network. This measure
generalizes across any subset of nodes and is not specific to communities
Usage
flow.frac(A, nodes)
Arguments
A An adjacency matrix
nodes A subset of nodes in the network
Value
Author(s)
References
Giscard, P. L., & Wilson, R. C. (2018). A centrality measure for cycles and subgraphs II. Applied
Network Science, 3, 9.
Examples
Description
These functions maximize a gain criterion for adding a node to a clique (and the larger network).
The flexibility of MFCF allows for any multivariate function to be used as a scoring function.
• "logLik"
The log determinant of the matrix restricted to the separator minus the log determinant of the
matrix restricted to the clique.
• "logLik.val"
"logLik" with a further validation based on the likelihood ratio. If the increase in gain is not
significant the routine stops adding nodes to the separator.
• "rSquared.val"
The R squared from the regression of the node against the clique. Only the clique nodes with a
regression coefficient significantly different from zero are added to the separator / new clique.
The gain is different from zero only if the F-values is significant, It assumed that the data
matrix is a dataset of realizations (i.e., p variables and n observations).
Usage
"logLik"
gfcnv_logdet(data, clique_id, cl, excl_nodes, ctreeControl)
"logLik.val"
gfcnv_logdet_val(data, clique_id, cl, excl_nodes, ctreeControl)
"rSquared.val"
gdcnv_lmfit(data, clique_id, cl, excl_nodes, ctreeControl)
Arguments
data Matrix or data frame. Can be a dataset or a correlation matrix
clique_id Numeric. Number corresponding to clique to add another node to
cl List. List of cliques already assembled in the network
excl_nodes Numeric vector. A vector of numbers corresponding to nodes not already in-
cluded in the network
ctreeControl List (length = 5). A list containing several parameters for controlling the clique
tree sizes:
• min_size Numeric. Minimum number of nodes allowed per clique. De-
faults to 1
• max_size Numeric. Maximum number of nodes allowed per clique. De-
faults to 8
gateway 37
Value
Returns the value with the maximum gain
Author(s)
Guido Previde Massara <gprevide@gmail.com> and Alexander Christensen <alexpaulchristensen@gmail.com>
References
Massara, G. P. & Aste, T. (2019). Learning clique forests. ArXiv.
Description
Computes the gateway coefficient for each node. The gateway coefficient measures a node’s con-
nections between its community and other communities. Nodes that are solely responsible for
inter-community connectivity will have higher gateway coefficient values. Positive and negative
signed weights for gateway coefficients are computed separately.
Usage
gateway(
A,
comm = c("walktrap", "louvain"),
cent = c("strength", "betweenness")
)
Arguments
A Network adjacency matrix
comm A vector of corresponding to each item’s community. Defaults to "walktrap"
for the cluster_walktrap community detection algorithm. Set to "louvain"
for the louvain community detection algorithm. Can also be set to user-specified
communities (see examples)
cent Centrality to community gateway coefficient. Defaults to "strength". Set to
"betweenness" to use the betweenness centrality
38 hybrid
Value
Returns a list containing:
overall Gateway coefficient without signs considered
positive Gateway coefficient with only positive sign
negative Gateway coefficient with only negative sign
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses and
interpretations. NeuroImage, 52, 1059-1069.
Vargas, E. R., & Wahl, L. M. (2014). The gateway coefficient: A novel metric for identifying
critical connections in modular networks. The European Physical Journal B, 87, 1-10.
Examples
#theoretical communities
comm <- rep(1:8, each = 6)
#walktrap communities
wgw <- gateway(A, comm = "walktrap")
Description
Computes hybrid centrality of each node in a network
Usage
hybrid(A, BC = c("standard", "random"), beta)
Arguments
A An adjacency matrix of network data
BC How should the betweenness centrality be computed? Defaults to "random".
Set to "standard" for standard betweenness.
beta Beta parameter to be passed to the rspbc function Defaults to .01
impact 39
Value
A vector of hybrid centrality values for each node in the network (higher values are more central,
lower values are more peripheral)
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Christensen, A. P., Kenett, Y. N., Aste, T., Silvia, P. J., & Kwapil, T. R. (2018). Network struc-
ture of the Wisconsin Schizotypy Scales-Short Forms: Examining psychometric network filtering
approaches. Behavior Research Methods, 50, 2531-2550.
Pozzi, F., Di Matteo, T., & Aste, T. (2013). Spread of risk across financial markets: Better to invest
in the peripheries. Scientific Reports, 3, 1655.
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
HC <- hybrid(A)
Description
Computes impact measure or how much the average distance in the network changes with that node
removed of each node in a network (Please see and cite Kenett et al., 2011)
Usage
impact(A)
Arguments
A An adjacency matrix of network data
Value
A vector of node impact values for each node in the network (impact > 0, greater ASPL when node
is removed; impact < 0, lower ASPL when node is removed)
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
40 is.graphical
References
Cotter, K. N., Christensen, A. P., & Silvia, P. J. (in press). Understanding inner music: A dimen-
sional approach to musical imagery. Psychology of Aesthetics, Creativity, and the Arts.
Kenett, Y. N., Kenett, D. Y., Ben-Jacob, E., & Faust, M. (2011). Global and local features of
semantic networks: Evidence from the Hebrew mental lexicon. PLoS one, 6, e23912.
Examples
# normal set to FALSE for CRAN tests
A <- TMFG(neoOpen, normal = FALSE)$A
Description
Tests for whether the network is graphical. Input must be a partial correlation network. Function
assumes that partial correlations were computed from a multivariate normal distribution
Usage
is.graphical(A)
Arguments
A A partial correlation network (adjacency matrix)
Value
Returns a TRUE/FALSE for whether network is graphical
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
Examples
## Not run:
A <- LoGo(neoOpen, normal = TRUE, partial = TRUE)
is.graphical(A)
## End(Not run)
kld 41
Description
Estimates the Kullback-Leibler Divergence which measures how one probability distribution di-
verges from the original distribution (equivalent means are assumed) Matrices must be positive
definite inverse covariance matrix for accurate measurement. This is a relative metric
Usage
kld(base, test)
Arguments
Value
A value greater than 0. Smaller values suggest the probability distribution of the reduced model is
near the full model
Author(s)
References
Kullback, S., & Leibler, R. A. (1951). On information and sufficiency. The Annals of Mathematical
Statistics, 22, 79-86.
Examples
A1 <- solve(cov(neoOpen))
## Not run:
A2 <- LoGo(neoOpen)
## End(Not run)
42 leverage
Description
Generates a lattice network
Usage
lattnet(nodes, edges)
Arguments
nodes Number of nodes in lattice network
edges Number of edges in lattice network
Value
Returns an adjacency matrix of a lattice network
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses and
interpretations. NeuroImage, 52, 1059-1069.
Examples
latt <- lattnet(10, 27)
Description
Computes leverage centrality of each node in a network (the degree of connected neighbors; Please
see and cite Joyce et al., 2010)
Usage
leverage(A, weighted = TRUE)
LoGo 43
Arguments
A An adjacency matrix of network data
weighted Is the network weighted? Defaults to TRUE. Set to FALSE for unweighted mea-
sure of leverage centrality
Value
A vector of leverage centrality values for each node in the network
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Joyce, K. E., Laurienti, P. J., Burdette, J. H., & Hayasaka, S. (2010). A new measure of centrality
for brain networks. PLoS One, 5 e12200.
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
#Weighted
levW <- leverage(A)
#Unweighted
levU <- leverage(A, weighted = FALSE)
Description
Applies the Local/Global method to estimate a Gaussian Graphical Model (GGM) using a TMFG-
filtered network (see and cite Barfuss et al., 2016). Also used to convert clique and separator
structure from MFCF into partial correlation and precision matrices
Usage
LoGo(
data,
cliques,
separators,
normal = TRUE,
na.data = c("pairwise", "listwise", "fiml", "none"),
partial = TRUE,
...
)
44 louvain
Arguments
data Must be a dataset
cliques Cliques defined in the network. Input can be a list or matrix
separators Separators defined in the network. Input can be a list or matrix
normal Should data be transformed to a normal distribution? Defaults to TRUE (com-
putes correlations using the cor_auto function). Set to FALSE for Pearson’s
correlations
na.data How should missing data be handled? For "listwise" deletion the na.omit
function is applied. Set to "fiml" for Full Information Maximum Likelihood
(corFiml). Full Information Maximum Likelihood is recommended but time
consuming
partial Should the output network’s connections be the partial correlation between two
nodes given all other nodes? Defaults to TRUE, which returns a partial correlation
matrix. Set to FALSE for a sparse inverse covariance matrix
... Additional arguments (deprecated arguments)
Value
Returns the sparse LoGo-filtered inverse covariance matrix (partial = FALSE) or LoGo-filtered
partial correlation matrix (partial = TRUE)
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Barfuss, W., Massara, G. P., Di Matteo, T., & Aste, T. (2016). Parsimonious modeling with infor-
mation filtering networks. Physical Review E, 94, 062306.
Examples
# normal set to FALSE for CRAN tests
LoGonet <- LoGo(neoOpen, normal = FALSE, partial = TRUE)
Description
Computes a vector of communities (community) and a global modularity measure (Q)
Usage
louvain(A, gamma, M0)
MaST 45
Arguments
A An adjacency matrix of network data
gamma Defaults to 1. Set to gamma > 1 to detect smaller modules and gamma < 1 for
larger modules
M0 Input can be an initial community vector. Defaults to NULL
Value
Returns a list containing:
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Blondel, V. D., Guillaume, J. L., Lambiotte, R., & Lefebvre, E. (2008). Fast unfolding of commu-
nities in large networks. Journal of Statistical Mechanics: Theory and Experiment, 2008, P10008.
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses and
interpretations. NeuroImage, 52, 1059-1069.
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
Description
Applies the Maximum Spanning Tree (MaST) filtering method
Usage
MaST(
data,
normal = TRUE,
na.data = c("pairwise", "listwise", "fiml", "none"),
depend = FALSE
)
46 MFCF
Arguments
data Can be a dataset or a correlation matrix
normal Should data be transformed to a normal distribution? Input must be a dataset.
Defaults to TRUE. Computes correlations using the cor_auto function. Set to
FALSE for Pearson’s correlation
na.data How should missing data be handled? For "listwise" deletion the na.omit
function is applied. Set to "fiml" for Full Information Maximum Likelihood
(corFiml). Full Information Maximum Likelihood is recommended but time
consuming
depend Is network a dependency (or directed) network? Defaults to FALSE. Set TRUE to
generate a MaST-filtered dependency network (output obtained from the depend
function)
Value
A sparse association matrix
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
Examples
# Pearson's correlation only for CRAN checks
MaST.net <- MaST(neoOpen, normal = FALSE)
Description
Applies the Maximally Filtered Clique Forest (MFCF) filtering method (Please see and cite Mas-
sara & Aste).
Usage
MFCF(
data,
cases = NULL,
na.data = c("pairwise", "listwise", "fiml", "none"),
time.series = FALSE,
gain.fxn = c("logLik", "logLik.val", "rSquared.val"),
min_size = 0,
max_size = 8,
pval = 0.05,
MFCF 47
pen = 0,
drop_sep = FALSE,
use_returns = FALSE
)
Arguments
data Matrix (n x n or p x n) or data frame. Can be a dataset or a correlation matrix
cases Numeric. If data is a (partial) correlation matrix, then number of cases must be
input. Defaults to NULL
na.data Character. How should missing data be handled?
• "listwise" Removes case if any missing data exists. Applies na.omit
• "pairwise" Estimates correlations using the available data for each vari-
able
• "fiml" Estimates correlations using the Full Information Maximum Like-
lihood. Recommended and most robust but time consuming
• "none" Default. No missing data or missing data has been handled by the
user
time.series Boolean. Is data a time-series dataset? Defaults to FALSE. Set to TRUE to handle
time-series data (n x p)
gain.fxn Character. Gain function to be used for inclusion of nodes in cliques. There are
several options available (see gain.functions for more details): "logLik",
"logLik.val", "rSquared.val". Defaults to "rSquared.val"
min_size Numeric. Minimum number of nodes allowed per clique. Defaults to 0
max_size Numeric. Maximum number of nodes allowed per clique. Defaults to 8
pval Numeric. p-value used to determine cut-offs for nodes to include in a clique
pen Numeric. Multiplies the number of edges added to penalise complex models.
Similar to the penalty term in AIC
drop_sep Boolean. This parameter influences the MFCF only. Defaults to FALSE. If TRUE,
then any separator can be used only once (similar to the TMFG)
use_returns Boolean. Only used in "gain.fxn = rSquared.val". If set to TRUE the regres-
sion is performed on log-returns. Defaults to FALSE
Value
Returns a list containing:
Author(s)
Guido Previde Massara <gprevide@gmail.com> and Alexander Christensen <alexpaulchristensen@gmail.com>
48 neoOpen
References
Examples
# Load data
data <- neoOpen
## Not run:
# Use polychoric correlations and R-squared method
MFCF.net <- MFCF(qgraph::cor_auto(data), cases = nrow(neoOpen))$A
## End(Not run)
Description
A response matrix (n = 802) of NEO-PI-3’s Openness to Experience from Christensen, Cotter, &
Silvia (2019).
Usage
data(neoOpen)
Format
References
Christensen, A. P., Cotter, K. N., & Silvia, P. J. (2019). Reopening openness to experience: A
network analysis of four openness to experience inventories. Journal of Personality Assessment,
101, 574-588.
Examples
data("neoOpen")
net.coverage 49
Description
Computes the mean distance across a subset of nodes in a network. This measure can be used to
identify the effectiveness of a subset of nodes’ coverage of the network space
Usage
net.coverage(A, nodes, weighted = FALSE)
Arguments
A An adjacency matrix
nodes Subset of nodes to examine the coverage of the network
weighted Is the network weighted? Defaults to FALSE. Set to TRUE for weighted measures
Value
Returns a list containing:
mean The average distance from the subset of nodes to all other nodes in the network
sd The standard deviation of distance from the subset of nodes to all other nodes in
the network
range The range of distance from the subset of nodes to all other nodes in the network
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com> and Mathias Benedek <mathias.benedek@uni-
graz.at>
References
Christensen, A. P., Cotter, K. N., Silvia, P. J., & Benedek, M. (2018) Scale development via network
analysis: A comprehensive and concise measure of Openness to Experience PsyArXiv, 1-40.
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
Description
Computes the mean distance across a subset of nodes in a network. This measure can be used to
identify the effectiveness of a subset of nodes’ coverage of the network space
Usage
network.coverage(A, nodes, weighted = FALSE)
Arguments
A An adjacency matrix
nodes Subset of nodes to examine the coverage of the network
weighted Is the network weighted? Defaults to FALSE. Set to TRUE for weighted measures
Value
Returns a list containing:
mean The average distance from the subset of nodes to all other nodes in the network
sd The standard deviation of distance from the subset of nodes to all other nodes in
the network
range The range of distance from the subset of nodes to all other nodes in the network
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com> and Mathias Benedek <mathias.benedek@uni-
graz.at>
References
Christensen, A. P., Cotter, K. N., Silvia, P. J., & Benedek, M. (2018) Scale development via network
analysis: A comprehensive and concise measure of Openness to Experience PsyArXiv, 1-40.
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
Description
Computes a permutation test to determine whether there are difference in centrality and global
network measures
Usage
network.permutation(
sample1 = NULL,
sample2 = NULL,
iter,
network = c("glasso", "ising", "TMFG", "LoGo"),
measure = c("betweenness", "closeness", "strength", "eigenvector", "rspbc", "hybrid",
"ASPL", "CC", "S", "Q"),
alternative = c("less", "greater", "two.tailed"),
ncores,
prev.perm = NULL
)
Arguments
Value
result The results of the permutation test. For centrality measures, this is a matrix
where the rows represent each node and the columns are the observed values of
the centrality measure for sample1, sample2, and the p-value from the permuta-
tion test. For global network measures, this is a vector with the observed values
of the global network measure for sample1, sample2, and the p-value from the
permutation test.
networks A list containing two lists: network1 and network2. The network lists cor-
respond to the networks generated in the permutation test for sample1 and
sample2, respectively. This output is used primarily for the computation of
other network measures using the same datasets (see prev.perm explanation)
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
Examples
# Split data (only for example)
split1 <- neoOpen[c(1:401),]
split2 <- neoOpen[c(402:802),]
# Check results
perm.str$result
# Check results
perm.aspl$result
Description
Applies a network filtering methodology to neural network array. Removes edges from the neural
network output from convertConnBrainMat using a network filtering approach
Usage
neuralnetfilter(
neuralarray,
method = c("TMFG", "MaST", "ECOplusMaST", "ECO", "threshold"),
openness 53
progBar = TRUE,
...
)
Arguments
neuralarray Array from convertConnBrainMat function
method Filtering method to be applied
progBar Should progress bar be displayed? Defaults to TRUE. Set FALSE for no progress
bar
... Additional arguments from network filtering methods
Value
Returns an array of n x n x m filtered matrices
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
Examples
## Not run: neuralarray <- convertConnBrainMat()
## End(Not run)
Description
A response matrix (n = 794) of all four Openness to Experience inventories from Christensen,
Cotter, & Silvia (2019). The key provides inventory, facet, and item description information for the
item labels. Note that because of NEO’s copyrights the items have been shortened and paraphrased
Usage
data(openness)
data(openness.key)
54 participation
Format
A 794 x 138 response matrix (openness) and 138 x 7 matrix (openness.key). Here are detailed
descriptions of the key:
References
Christensen, A. P., Cotter, K. N., & Silvia, P. J. (2019). Reopening openness to experience: A
network analysis of four openness to experience inventories. Journal of Personality Assessment,
101, 574-588.
Examples
# Loading data
data("openness")
data("openness.key")
Description
Computes the participation coefficient for each node. The participation coefficient measures the
strength of a node’s connections within its community. Positive and negative signed weights for
participation coefficients are computed separately.
Usage
participation(A, comm = c("walktrap", "louvain"))
participation 55
Arguments
Details
Values closer to 1 suggest greater within-community connectivity and values closer to 0 suggest
greater between-community connectivity
Value
Author(s)
References
Guimera, R., & Amaral, L. A. N. (2005). Functional cartography of complex metabolic networks.
Nature, 433, 895-900.
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses and
interpretations. NeuroImage, 52, 1059-1069.
Examples
#theoretical factors
comm <- rep(1:8, each = 6)
# Walktrap factors
wpc <- participation(A, comm = "walktrap")
56 pathlengths
Description
Computes global average shortest path length, local average shortest path length, eccentricity, and
diameter of a network
Usage
pathlengths(A, weighted = FALSE)
Arguments
A An adjacency matrix of network data
weighted Is the network weighted? Defaults to FALSE. Set to TRUE for weighted measures
Value
Returns a list containing:
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses and
interpretations. NeuroImage, 52, 1059-1069.
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
#Unweighted
PL <- pathlengths(A)
#Weighted
PL <- pathlengths(A, weighted = TRUE)
plot.cpm 57
Description
Plots CPM results
Usage
## S3 method for class 'cpm'
plot(x, ...)
Arguments
x A cpm object
... Additional arguments for plot
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
Description
Generates a random binary network
Usage
randnet(nodes = NULL, edges = NULL, A = NULL)
Arguments
nodes Numeric. Number of nodes in random network
edges Numeric. Number of edges in random network
A Matrix or data frame. An adjacency matrix (i.e., network) to be used to estimated
a random network with fixed edges (allows for asymmetric network estimation)
Value
Returns an adjacency matrix of a random network
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
58 reg
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses and
interpretations. NeuroImage, 52, 1059-1069.
Csardi, G., & Nepusz, T. (2006). The igraph software package for complex network research.
InterJournal, Complex Systems, 1695.
Examples
rand <- randnet(10, 27)
Description
Computes regression such that one variable is regressed over all other variables
Usage
reg(
data,
family = c("binomial", "gaussian", "Gamma", "poisson"),
symmetric = TRUE
)
Arguments
data A dataset
family Error distribution to be used in the regression model. Defaults to "logistic".
Set to any family used in function family
symmetric Should matrix be symmetric? Defaults to TRUE, taking the mean of the two
edge weights (i.e., [i,j] and [j,i]) Set to FALSE for asymmetric weights (i.e.,
[i,j] does not equal [j,i])
Value
A matrix of fully regressed coefficients where one variable is regressed over all others
Author(s)
Examples
#binarize responses
psyb <- ifelse(neoOpen>=4, 1, 0)
Description
Screens data to identify potential cases of repeated responding. The function is based on two cri-
teria: no variance (i.e., a standard deviation of zero for given responses)and frequency proportion
of the response values (which is set by freq.prop). Note that these criteria are highly related.
Additional criteria will be added in the future.
Usage
resp.rep(data, scale.lens = NULL, max.val, reverse = NULL, freq.prop = 0.8)
Arguments
data A dataset
scale.lens The number of items for each scale in the data. A vector indicating the length
for each scale to be checked in the data
max.val Maximum value for data (or scales). If scales have different maximum values,
then a vector must be input with each scale’s maximum value (see examples)
reverse Reverse scored responses. If responses have not yet reversed, then do not reverse
them. If responses have been reversed, then a vector indicating which responses
have been reverse-scored should be input (see examples). Can be TRUE/FALSE
or 1/0 (reversed/not reversed)
freq.prop Frequency proportion of the response values. Allows the researcher to determine
the maximum frequency proportion of a certain response value is suspicious.
The default is set to .80 (or 80 percent responses are a single value)
Details
If a case is returned, then it does not mean that it is a bad case. Researchers should thoroughly
inspect each case that is returned. A general guideline is that if a participant responded with all
middle values (e.g., all 3’s on a 5-point Likert scale), then they should be dropped. Note that a
participant who responds with all maximum or minimum values may be a real case or a bad case.
It is up to the researcher to decide and justify why or why not a case is kept.
60 rmse
Value
Returns a matrix when scale.lens = NULL and a list with elements corresponding to the order of
scales. In general, the output contains potential bad cases that should be further inspected by the
researcher.
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
Examples
#Re-reverse responses
rev.vec <- c(TRUE,FALSE,TRUE,FALSE,TRUE,TRUE,TRUE,FALSE,TRUE,FALSE,
TRUE,FALSE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE,TRUE,FALSE,TRUE,FALSE,TRUE,
FALSE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE,TRUE,FALSE,TRUE,FALSE,TRUE,
FALSE,TRUE,FALSE,FALSE,TRUE,FALSE,TRUE,TRUE,FALSE,FALSE,TRUE,FALSE,TRUE)
#Maximum values
mv.vec <- c(5, 5, 5, 5, 5, 5)
#Re-reverse responses
rev.vec <- c(TRUE,FALSE,TRUE,FALSE,TRUE,TRUE,TRUE,FALSE,TRUE,FALSE,
TRUE,FALSE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE,TRUE,FALSE,TRUE,FALSE,TRUE,
FALSE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE,TRUE,FALSE,TRUE,FALSE,TRUE,
FALSE,TRUE,FALSE,FALSE,TRUE,FALSE,TRUE,TRUE,FALSE,FALSE,TRUE,FALSE,TRUE)
Description
Computes the root mean square error (RMSE) of a sparse model to a full model
rspbc 61
Usage
rmse(base, test)
Arguments
base Base (or full) model to be evaluated against
test Reduced (or testing) model (e.g., a sparse correlation or covariance matrix)
Value
RMSE value (lower values suggest more similarity between the full and sparse model)
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
Examples
A1 <- solve(cov(neoOpen))
## Not run:
A2 <- LoGo(neoOpen)
## End(Not run)
Description
Computes betweenness centrality based on randomized shortest paths of each node in a network
(Please see and cite Kivimaki et al., 2016)
Usage
rspbc(A, beta = 0.01, comm = NULL)
Arguments
A An adjacency matrix of network data
beta Sets the beta parameter. Defaults to 0.01 (recommended). Beta > 0.01 measure
gets closer to weighted betweenness centrality (10) and beta < 0.01 measure gets
closer to degree (.0001)
comm Vector. Community vector containing a value for each node. Computes "bridge"
RSPBC, where the number of times a node is used on a random path between to
another community
62 sim.chordal
Value
A vector of randomized shortest paths betweenness centrality values for each node in the network
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Kivimaki, I., Lebichot, B., Saramaki, J., & Saerens, M. (2016). Two betweenness centrality mea-
sures based on Randomized Shortest Paths. Scientific Reports, 6, 19668.
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
Description
Simulates a chordal network based on number of nodes. Data will also be simulated based on the
true network structure
Usage
sim.chordal(
nodes,
inverse = c("cases", "matrix"),
n = NULL,
ordinal = FALSE,
ordLevels = NULL,
idio = NULL,
eps = NULL
)
Arguments
nodes Numeric. Number of nodes in the simulated network
inverse Character. Method to produce inverse covariance matrix.
• "cases"Estimates inverse covariance matrix based on n number of cases
and nodes number of variables, which are drawn from a random normal
distribution rnorm. Data generated will be continuous unless ordinal is
set to TRUE
sim.chordal 63
Value
Author(s)
References
Examples
#Continuous data
sim.Norm <- sim.chordal(nodes = 20, inverse = "cases", n = 1000)
#Ordinal data
sim.Likert <- sim.chordal(nodes = 20, inverse = "cases", n = 1000, ordinal = TRUE)
#Dichotomous data
sim.Binary <- sim.chordal(nodes = 20, inverse = "cases", n = 1000, ordinal = TRUE, ordLevels = 5)
64 sim.swn
Description
Simulates a small-world network based on specified topological properties. Data will also be simu-
lated based on the true network structure
Usage
sim.swn(
nodes,
n,
pos = 0.8,
ran = c(0.3, 0.7),
nei = 1,
p = 0.5,
corr = FALSE,
replace = NULL,
ordinal = FALSE,
ordLevels = NULL
)
Arguments
nodes Number of nodes in the simulated network
n Number of cases in the simulated dataset
pos Proportion of positive correlations in the simulated network
ran Range of correlations in the simulated network
nei Adjusts the number of connections each node has to neighboring nodes (see
sample_smallworld)
p Adjusts the rewiring probability (default is .5). p > .5 rewires the simulated
network closer to a random network. p < .5 rewires the simulated network closer
to a lattice network
corr Should the simulated network be a correlation network? Defaults to FALSE. Set
to TRUE for a simulated correlation network
replace If noise > 0, then should participants be sampled with replacement? Defaults to
TRUE. Set to FALSE to not allow the potential for participants to be consecu-
tively entered into the simulated dataset.
ordinal Should simulated continuous data be converted to ordinal? Defaults to FALSE.
Set to TRUE for simulated ordinal data
ordLevels If ordinal = TRUE, then how many levels should be used? Defaults to NULL.
Set to desired number of intervals (defaults to 5)
smallworldness 65
Value
Returns a list containing:
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Csardi, G., & Nepusz, T. (2006). The igraph software package for complex network research.
InterJournal, Complex Systems, 1695, 1-9.
Examples
#Continuous data
sim.Norm <- sim.swn(25, 500, nei = 3)
#Ordinal data
sim.Likert <- sim.swn(25, 500, nei = 3, replace = TRUE, ordinal = TRUE, ordLevels = 5)
#Dichotomous data
sim.Binary <- sim.swn(25, 500, nei = 3, replace = TRUE, ordinal = TRUE, ordLevels = 2)
Description
Computes the small-worldness measure of a network
Usage
smallworldness(
A,
iter = 100,
progBar = FALSE,
method = c("HG", "rand", "TJHBL")
)
66 smallworldness
Arguments
A An adjacency matrix of network data
iter Number of random (or lattice) networks to generate, which are used to calculate
the mean random ASPL and CC (or lattice)
progBar Defaults to FALSE. Set to TRUE to see progress bar
method Defaults to "HG" (Humphries & Gurney, 2008). Set to "rand" for the CC to be
calculated using a random network or set to "TJHBL" for (Telesford et al., 2011)
where CC is calculated from a lattice network
Details
For "rand", values > 1 indicate a small-world network. For "HG", values > 3 indicate a small-world
network. For "TJHBL", values near 0 indicate a small-world network, while < 0 indicates a more
regular network and > 0 indicates a more random network
Value
Returns a list containing:
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Humphries, M. D., & Gurney, K. (2008). Network ’small-world-ness’: A quantitative method for
determining canonical network equivalence. PLoS one, 3, e0002051.
Telesford, Q. K., Joyce, K. E., Hayasaka, S., Burdette, J. H., & Laurienti, P. J. (2011). The ubiquity
of small-world networks. Brain Connectivity, 1(5), 367-375.
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
Description
Computes the within-community centrality for each node in the network
Usage
stable(
A,
comm = c("walktrap", "louvain"),
cent = c("betweenness", "rspbc", "closeness", "strength", "degree", "hybrid"),
absolute = TRUE,
diagonal = 0,
...
)
Arguments
A An adjacency matrix of network data
comm Can be a vector of community assignments or community detection algorithms
("walktrap" or "louvain") can be used to determine the number of factors.
Defaults to "walktrap". Set to "louvain" for louvain community detection
cent Centrality measure to be used. Defaults to "strength".
absolute Should network use absolute weights? Defaults to TRUE. Set to FALSE for signed
weights
diagonal Sets the diagonal values of the A input. Defaults to 0
... Additional arguments for cluster_walktrap and louvain community detec-
tion algorithms
Value
A matrix containing the within-community centrality value for each node
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Blanken, T. F., Deserno, M. K., Dalege, J., Borsboom, D., Blanken, P., Kerkhof, G. A., & Cramer,
A. O. (2018). The role of stabilizing and communicating symptoms given overlapping communities
in psychopathology networks. Scientific Reports, 8, 5854.
68 strength
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
Description
Computes strength of each node in a network
Usage
strength(A, absolute = TRUE)
Arguments
A An adjacency matrix of network data
absolute Should network use absolute weights? Defaults to TRUE. Set to FALSE for signed
weights
Value
A vector of strength values for each node in the network.
If directed network, returns a list containing:
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses and
interpretations. NeuroImage, 52 1059-1069.
threshold 69
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
#Directed network
## Not run:
dep <- depend(neoOpen)
## End(Not run)
Description
Filters the network based on an r-value, alpha, adaptive alpha, bonferroni, false-discovery rate
(FDR), or proportional density (fixed number of edges) value
Usage
threshold(
data,
a,
thresh = c("alpha", "adaptive", "bonferroni", "FDR", "proportional"),
normal = FALSE,
na.data = c("pairwise", "listwise", "fiml", "none"),
...
)
Arguments
data Can be a dataset or a correlation matrix
a When thresh = "alpha", "adaptive", and "bonferroni" an α threshold is
applied (defaults to .05). For "adaptive", beta (Type II error) is set to α ∗ 5
for a medium effect size (r = .3). When thresh = "FDR", a q-value threshold is
applied (defaults to .10). When thresh = "proportional", a density threshold
is applied (defaults to .15)
thresh Sets threshold. Defaults to "alpha". Set to any value 0> r >1 to retain values
greater than set value, "adaptive" for an adapt.a based on sample size (Perez
& Pericchi, 2014), "bonferroni" for the bonferroni correction on alpha, "FDR"
for local false discovery rate, and "proportional" for a fixed density of edges
(keeps strongest correlations within density)
70 TMFG
Value
Returns a list containing:
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Strimmer, K. (2008). fdrtool: A versatile R package for estimating local and tail area-based false
discovery rates. Bioinformatics, 24, 1461-1462.
Examples
threshnet<-threshold(neoOpen)
Description
Applies the Triangulated Maximally Filtered Graph (TMFG) filtering method (Please see and cite
Massara et al., 2016). The TMFG method uses a structural constraint that limits the number of
zero-order correlations included in the network (3n - 6; where n is the number of variables). The
TMFG algorithm begins by identifying four variables which have the largest sum of correlations to
all other variables. Then, it iteratively adds each variable with the largest sum of three correlations
to nodes already in the network until all variables have been added to the network. This structure
TMFG 71
can be associated with the inverse correlation matrix (i.e., precision matrix) to be turned into a GGM
(i.e., partial correlation network) by using LoGo. See Details for more information on this network
estimation method.
Usage
TMFG(
data,
normal = TRUE,
na.data = c("pairwise", "listwise", "fiml", "none"),
depend = FALSE
)
Arguments
data Can be a dataset or a correlation matrix
normal Should data be transformed to a normal distribution? Input must be a dataset.
Defaults to TRUE. Computes correlations using the cor_auto function. Set to
FALSE for Pearson’s correlation
na.data How should missing data be handled? For "listwise" deletion the na.omit
function is applied. Set to "fiml" for Full Information Maximum Likelihood
(corFiml). Full Information Maximum Likelihood is recommended but time
consuming
depend Is network a dependency (or directed) network? Defaults to FALSE. Set to TRUE
to generate a TMFG-filtered dependency network (output obtained from the
depend function)
Details
The TMFG method applies a structural constraint on the network, which restrains the network to
retain a certain number of edges (3n-6, where n is the number of nodes; Massara et al., 2016). The
network is also composed of 3- and 4-node cliques (i.e., sets of connected nodes; a triangle and
tetrahedron, respectively). The TMFG method constructs a network using zero-order correlations
and the resulting network can be associated with the inverse covariance matrix (yielding a GGM;
Barfuss, Massara, Di Matteo, & Aste, 2016). Notably, the TMFG can use any association measure
and thus does not assume the data is multivariate normal.
Construction begins by forming a tetrahedron of the four nodes that have the highest sum of corre-
lations that are greater than the average correlation in the correlation matrix. Next, the algorithm
iteratively identifies the node that maximizes its sum of correlations to a connected set of three
nodes (triangles) already included in the network and then adds that node to the network. The
process is completed once every node is connected in the network. In this process, the network
automatically generates what’s called a planar network. A planar network is a network that could
be drawn on a sphere with no edges crossing (often, however, the networks are depicted with edges
crossing; Tumminello, Aste, Di Matteo, & Mantegna, 2005).
Value
Returns a list containing:
72 transitivity
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
References
Christensen, A. P., Kenett, Y. N., Aste, T., Silvia, P. J., & Kwapil, T. R. (2018). Network struc-
ture of the Wisconsin Schizotypy Scales-Short Forms: Examining psychometric network filtering
approaches. Behavior Research Methods, 50, 2531-2550.
Massara, G. P., Di Matteo, T., & Aste, T. (2016). Network filtering for big data: Triangulated
maximally filtered graph. Journal of Complex Networks, 5, 161-178.
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
transitivity Transitivity
Description
Computes transitivity of a network
Usage
transitivity(A, weighted = FALSE)
Arguments
A An adjacency matrix of network data
weighted Is the network weighted? Defaults to FALSE. Set to TRUE for a weighted measure
of transitivity
Value
Returns a value of transitivity
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
un.direct 73
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses and
interpretations. NeuroImage, 52, 1059-1069.
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
Description
Converts a directed network to an undirected network
Usage
un.direct(A, diagonal = 0)
Arguments
A Matrix or data frame. Adjacency matrix (network matrix)
diagonal Numeric. Number to be placed on the diagonal. Defaults to 0
Value
Returns a symmetric adjacency matrix
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
Examples
# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A
∗ datasets desc.all, 28
behavOpen, 6 distance, 29
neoOpen, 48 diversity, 30
openness, 53
ECO, 31, 32
adapt.a, 4, 69, 70 ECOplusMaST, 32
edgerep, 32
behavOpen, 6 eigenvector, 34, 35
betweenness, 6, 37, 38
binarize, 7 family, 58
fdrtool, 70
closeness, 8 flow.frac, 12, 35
clustcoeff, 9
gain.functions, 36, 47
cluster_walktrap, 10, 30, 37, 55, 67
gateway, 37
comcat, 10
gdcnv_lmfit (gain.functions), 36
comm.close, 11
gfcnv_logdet (gain.functions), 36
comm.eigen, 12
gfcnv_logdet_val (gain.functions), 36
comm.str, 13
conn, 14 hybrid, 17, 38
convert2igraph, 15
convertConnBrainMat, 15, 16, 19, 20, 22, 23, igraph, 15
27, 52, 53 impact, 39
cor2cov, 17 is.graphical, 40
cor_auto, 25, 44, 46, 70, 71
core.items, 17 kld, 41
corFiml, 26, 44, 46, 70, 71
lattnet, 42
cpm, 18, 20, 57
leverage, 42
cpmEV (cpm), 18
LoGo, 43, 47, 71, 72
cpmFP (cpm), 18
louvain, 10, 30, 37, 44, 55, 67
cpmFPperm (cpm), 18
cpmIV (cpm), 18 MaST, 32, 45
cpmIVperm (cpm), 18 MFCF, 36, 43, 46
cpmPlot (cpm), 18
na.omit, 26, 44, 46, 47, 70, 71
dCor, 22, 23 neoOpen, 48
dCor.parallel, 22, 23 net.coverage, 49
degree, 13, 24 network.coverage, 50
depend, 25, 27, 46, 71 network.permutation, 51
depna, 26 NetworkToolbox
desc, 27 (NetworkToolbox-package), 3
74
INDEX 75
NetworkToolbox-package, 3
neuralnetfilter, 52
openness, 53
participation, 54
pathlengths, 56
plot, 57
plot.cpm, 57
psych, 63, 65
qgraph, 20
randnet, 57
reg, 58
resp.rep, 59
rmse, 60
rnorm, 62
rspbc, 38, 61
sample_smallworld, 64
shapiro.test, 28
sim.chordal, 62
sim.swn, 64
smallworldness, 65
stable, 67
strength, 13, 68
threshold, 69
TMFG, 43, 47, 70
transitivity, 72
un.direct, 73