View source: R/wrangle-weights.R
| threshold_edges | R Documentation |
Keeps the edges that satisfy every criterion supplied. The operation
corresponds to qgraph's minimum argument and to
tna::prune(). The result is a network that can be analysed and
plotted.
threshold_edges(
x,
minimum = NULL,
maximum = NULL,
proportion = NULL,
density = NULL,
top = NULL,
absolute = TRUE,
keep_isolates = TRUE,
keep_format = FALSE,
directed = NULL
)
x |
Network input: cograph_network, matrix, igraph, network, tna, or an edge-list data frame. |
minimum |
Numeric. Keep edges whose weight is at least this value. |
maximum |
Numeric. Keep edges whose weight is at most this value. |
proportion |
Numeric in (0, 1]. Keep this fraction of the edges, the strongest first. |
density |
Numeric in (0, 1]. Keep as many of the strongest edges as gives this density (edges as a fraction of the possible edges). |
top |
Non-negative integer. Keep this many edges, the strongest first.
|
absolute |
Logical. Compare |
keep_isolates |
Logical. Keep nodes that end up with no edges? Default
TRUE. Set FALSE, or call |
keep_format |
Logical. Return the input format when TRUE. |
directed |
Logical or NULL. If NULL (default), auto-detect. |
Several criteria are combined with AND. For example,
threshold_edges(x, minimum = 0.2, top = 20) keeps the twenty
strongest edges among those of weight at least 0.2. When proportion,
density and top are combined, the smallest of the implied
edge counts is used.
Ties at the cut point are all kept, so top = 10 can return more than
ten edges when the tenth and eleventh weights are equal. The result
therefore does not depend on the order in which the edges are stored.
A cograph_network with the surviving edges, or the input
format when keep_format = TRUE. Every node is kept unless
keep_isolates = FALSE; nodes the threshold stranded are reported in
a cograph_isolates_created warning. A non-finite minimum or
maximum, a proportion or density outside (0, 1],
and a negative or fractional top raise a
cograph_bad_selection error.
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(4), 1–18.
binarize, filter_edges,
disparity_filter, remove_isolates
threshold_edges(regulation_net, minimum = 0.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.