| net_prune | R Documentation |
Removes weak or non-significant edges from a network, keeping a record so
the operation can be reversed. This is Nestimate's counterpart of
tna::prune(); the net_ prefix avoids a name clash with
tna::prune().
net_prune(
x,
method = "threshold",
threshold = 0.1,
lowest = 0.05,
level = 0.5,
boot = NULL,
...
)
## S3 method for class 'netobject'
net_prune(
x,
method = "threshold",
threshold = 0.1,
lowest = 0.05,
level = 0.5,
boot = NULL,
...
)
## S3 method for class 'netobject_group'
net_prune(
x,
method = "threshold",
threshold = 0.1,
lowest = 0.05,
level = 0.5,
boot = NULL,
...
)
## Default S3 method:
net_prune(
x,
method = "threshold",
threshold = 0.1,
lowest = 0.05,
level = 0.5,
boot = NULL,
...
)
x |
A |
method |
One of |
threshold |
Numeric cut-off for |
lowest |
Quantile (0-1) for |
level |
Significance level (0-1) for |
boot |
Optional precomputed |
... |
Passed to |
Pruning is non-destructive: the pruned network carries a "pruning"
attribute holding the original weights, the pruned weights, the parameters
used, and a tidy table of removed edges. Use net_deprune to
restore the original weights and net_reprune to re-apply the
pruning, both without recomputation. net_pruning_details
reports what was removed.
Methods:
"threshold"Remove edges with weight \le
threshold.
"lowest"Remove the lowest lowest quantile of
non-zero edges.
"disparity"Serrano disparity-filter backbone at
significance level.
"bootstrap"Remove edges deemed non-significant by
bootstrap_network (pass a precomputed result via
boot, or extra bootstrap arguments via ...).
For "threshold", "lowest", and "disparity" an edge is
dropped only when its removal leaves the network weakly connected.
Diagonal self-loops (self-transitions) are observed data: they are counted
equally when computing the cut-off but are never removed by any method.
(This is a deliberate divergence from tna::prune(), which prunes
self-loops like any other edge.)
The input network (or group) with pruned $weights and a
"pruning" attribute. Class is unchanged.
net_deprune, net_reprune,
net_pruning_details
seqs <- data.frame(
V1 = c("A","B","A","C","B"), V2 = c("B","C","B","A","C"),
V3 = c("C","A","C","B","A"))
net <- build_network(seqs, method = "relative")
pruned <- net_prune(net, method = "threshold", threshold = 0.2)
net_pruning_details(pruned)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.