Convert a collection of spatial interaction model into a Data Frame
Source:R/sim_list.R
as.data.frame.sim_list.Rd
This function build a data frame from a collection of spatial interaction model.
Usage
# S3 method for class 'sim_list'
as.data.frame(x, ..., models = TRUE)
Details
The data frame has one row per spatial interaction model and the following columns:
alpha
: the return to scale parameter used to build the modelbeta
: the cost inverse scale parameter used to build the modeldiversity
: model diversityterminals
: if the model is not bipartite, the terminals of the modelmodel
: ifmodels=TRUE
, the model
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,
bipartite = FALSE
)
as.data.frame(all_flows, models = FALSE)
#> alpha beta diversity terminals
#> 1 1.25 1 1.000000 1
#> 2 1.50 1 1.000000 1
#> 3 1.25 2 4.471054 1, 2, 3,....
#> 4 1.50 2 3.538074 1, 2, 3,....
#> 5 1.25 3 6.060708 1, 2, 3,....
#> 6 1.50 3 4.513024 1, 2, 3,....