flow | R Documentation |
Converts distance to flow (1-d) with or without data standardization
flow(x, standardize = FALSE, rm.na = FALSE, diag.value = NA)
x |
A numeric vector or matrix object representing distances |
standardize |
(FALSE/TRUE) Row-standardize the data before calculating flow |
rm.na |
(TRUE/FALSE) Should NA's be removed, if FALSE (default) the will be retained in the results |
diag.value |
If x is a matrix, what diagonal matrix values should be used (default is NA) |
A vector or matrix representing flow values
Jeffrey S. Evans <jeffrey_evans@tnc.org> and Melanie A. Murphy <melanie.murphy@uwyo.edu>
#### On a distance vector
flow(runif(10,0,1))
flow(runif(10,0,500), standardize = TRUE)
# With NA's
d <- runif(10, 0,1)
d[2] <- NA
flow(d)
flow(d, rm.na=TRUE)
#### On a distance matrix
dm <- as.matrix(dist(runif(5,0,1), diag = TRUE, upper = TRUE))
flow(dm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.