Check if candidate links meet crossmap properties
verify_links_as_xmap.Rd
The links must satisfy:
no missing values
at most one link between each unique source and target node
the weights on links coming out of each source node sum to 1
Arguments
- df
data.frame like object containing candidate links
- from, to
Columns in
x
specifying the source and target nodes- weights
Column in
x
specifying the weight applied to data passed along the directed link between source and target node- tol
numeric \(\ge 0\). Ignore differences smaller than
tol
. Passed through to thetolerance
arg ofbase::all.equal()
.
Examples
# For a well formed crossmap:
links <- data.frame(
a = "AUS",
b = c("VIC", "NSW", "WA", "OTHER"),
w = c(0.1, 0.15, 0.25, 0.5)
)
verify_links_as_xmap(links, from = a, to = b, weights = w)