View source: R/wrangle-weights.R
| binarize | R Documentation |
Replaces every surviving weight with 1 and drops edges whose weight is at
or below the threshold. The operation corresponds to
sna::event2dichot() with an absolute threshold.
binarize(
x,
threshold = 0,
absolute = TRUE,
signed = FALSE,
keep_isolates = TRUE,
keep_format = FALSE,
directed = NULL
)
x |
Network input. |
threshold |
Numeric. Edges whose weight exceeds this value are kept and set to 1. Default 0, which keeps every existing edge. |
absolute |
Logical. Compare |
signed |
Logical. If TRUE, negative edges become |
keep_isolates |
Logical. Keep nodes that end up with no edges? Default TRUE. |
keep_format |
Logical. Return the input format when TRUE. |
directed |
Logical or NULL. If NULL (default), auto-detect. |
A cograph_network whose weights are all 1 (or, when
signed = TRUE, 1 for a positive edge and -1 for a
negative one), or the input format when keep_format = TRUE. Nodes
left without edges are kept and reported in a
cograph_isolates_created warning, unless
keep_isolates = FALSE.
Butts, C. T. (2008). Social network analysis with sna. Journal of Statistical Software, 24(6), 1–51.
threshold_edges, normalize_weights
binarize(regulation_net, threshold = 0.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.