Learn R Programming

blvim (version 0.1.1)

as.data.frame.sim_list: Coerce to a Data Frame

Description

This function creates a data frame with a single column storing its collection of spatial interaction models. The default name of the column is "sim" (can be modified using the sim_column parameter). An more flexible alternative is provided by the sim_df() function.

Usage

# S3 method for sim_list
as.data.frame(x, ..., sim_column = "sim")

Value

a data frame

Arguments

x

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

...

additional parameters (not used currently)

sim_column

the name of the sim_list column (default "sim")

See Also

sim_df()

Examples

Run this code
distances <- french_cities_distances[1:15, 1:15] / 1000 ## convert to km
production <- log(french_cities$population[1:15])
attractiveness <- log(french_cities$area[1:15])
all_flows_log <- grid_blvim(
  distances, production, c(1.1, 1.25, 1.5),
  c(1, 2, 3, 4) / 500, attractiveness,
  epsilon = 0.1,
  bipartite = FALSE,
  iter_max = 750
)
as.data.frame(all_flows_log, sim_column = "log flows")

Run the code above in your browser using DataLab