Skip to contents

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.

Usage

sim_df(x)

Arguments

x

a collection of spatial interaction models, an object of class sim_list

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 model

  • alpha: the return to scale parameter used to build the model

  • beta: the cost inverse scale parameter used to build the model

  • diversity: model default diversity() (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 by blvim() and related approaches), FALSE for no convergence and NA 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