Create a spatial interaction models data frame from a collection of interaction models
Source:R/sim_df.R
sim_df.Rd
This function build a data frame from a collection of spatial interaction
models. The data frame has a list column sim
which stores the collection
of models and classical columns that contain characteristics of the models.
See details for the default columns.
Value
a data frame representation of the spatial interaction model collection
with classes sim_df
and data.frame
Details
The data frame has one row per spatial interaction model and the following columns:
sim
: the last column that contains the modelalpha
: the return to scale parameter used to build the modelbeta
: the cost inverse scale parameter used to build the modeldiversity
: model defaultdiversity()
(Shannon's diversity)iterations
: the number of iterations used to produce the model (1 for a static model)converged
:TRUE
is the iterative calculation of the model converged (for models produced byblvim()
and related approaches),FALSE
for no convergence andNA
for static models
Examples
positions <- matrix(rnorm(10 * 2), ncol = 2)
distances <- as.matrix(dist(positions))
production <- rep(1, 10)
attractiveness <- c(2, rep(1, 9))
all_flows <- grid_blvim(distances, production, c(1.25, 1.5), c(1, 2, 3), attractiveness)
all_flows_df <- sim_df(all_flows)
all_flows_df$converged
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE