Extract the common cost matrix from a collection of spatial interaction models
Source:R/sim_list_common.R
costs.sim_list.Rd
Extract the common cost matrix from a collection of spatial interaction models
Usage
# S3 method for class 'sim_list'
costs(sim, ...)
Examples
positions <- matrix(rnorm(15 * 2), ncol = 2)
distances <- as.matrix(dist(positions))
production <- rep(1, 15)
attractiveness <- rep(1, 15)
all_flows <- grid_blvim(distances,
production,
c(1.1, 1.25, 1.5),
c(1, 2, 3),
attractiveness,
epsilon = 0.1
)
## should be TRUE
identical(distances, costs(all_flows))
#> [1] TRUE