Learn R Programming

TDLM (version 1.0.0)

extract_opportunities: Compute the number of opportunities between pairs of locations

Description

This function computes the number of opportunities between pairs of locations as defined in Lenormand2016;textualTDLM. For a given pair of location the number of opportunities between the location of origin and the location of destination is based on the number of opportunities in a circle of radius equal to the distance between origin and destination centered in the origin. The number of opportunities at origin and destination are not included.

Usage

extract_opportunities(opportunity, distance, check_names = FALSE)

Value

A squared matrix in which each element represents the number of opportunities between a pair of locations.

Arguments

opportunity

a numeric vector representing the number of opportunities per location. The value should be positive.

distance

a squared matrix representing the distance between locations.

check_names

a boolean indicating if the ID location are used as vector names, matrix rownames and colnames and if they should be checked (see Note).

Author

Maxime Lenormand (maxime.lenormand@inrae.fr)

References

Lenormand2016TDLM

See Also

calib_param() extract_spatial_information() check_format_names()

Examples

Run this code
data(mass)
data(distance)

opportunity <- mass[, 1]

sij <- extract_opportunities(
  opportunity = opportunity,
  distance = distance,
  check_names = FALSE
)

Run the code above in your browser using DataLab