flow {GeNetIt}R Documentation

Convert distance to flow

Description

Converts distance to flow (1-d) with or without data standardization

Usage

flow(x, standardize = FALSE, rm.na = FALSE, diag.value = NA)

Arguments

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)

Value

A vector or matrix representing flow values

Author(s)

Jeffrey S. Evans <jeffrey_evans@tnc.org> and Melanie A. Murphy <melanie.murphy@uwyo.edu>

Examples

#### 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)


[Package GeNetIt version 0.1-6 Index]