View source: R/wrangle-weights.R
| normalize_weights | R Documentation |
Rescales the edge weights. Row normalization turns a transition count matrix into the transition probabilities used by TNA models.
normalize_weights(
x,
method = c("row", "column", "max", "sum", "minmax"),
keep_format = FALSE,
directed = NULL
)
x |
Network input. |
method |
How to rescale:
|
keep_format |
Logical. Return the input format when TRUE. |
directed |
Logical or NULL. If NULL (default), auto-detect. |
A row or column whose total is zero is left at zero. Zero totals, and a zero
denominator for "max" or "sum", raise a
cograph_zero_norm warning.
"minmax" maps the weakest edge to .Machine$double.eps. A
weight of exactly 0 would remove the edge, because 0 stores "no edge". When
all weights are equal they all become 1.
"max", "sum" and "minmax" rescale each edge
independently and keep any extra edge columns. "row" and
"column" scale an edge by a total that differs at its two endpoints.
They break symmetry, so an undirected input is returned as a directed
network.
A cograph_network with rescaled weights, or the input format
when keep_format = TRUE.
binarize, invert_weights,
symmetrize
normalize_weights(regulation_net, method = "row")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.