Skip to contents

Title

Usage

sim_schools(
  origins,
  destinations,
  model,
  ...,
  balancing = c("origins", "destinations", "both"),
  max_dist = Inf,
  origins.id = names(origins)[1],
  origins.size = names(origins)[2],
  destinations.id = names(destinations)[1],
  destinations.size = names(destinations)[2],
  keep_cols = FALSE,
  output_col = "modelled_trips",
  max_iter = 25
)

Arguments

origins

An sf object representing the origins.

destinations

An sf object representing the destinations.

model

A character string specifying the model to use.

...

Additional arguments to be passed to the model function.

balancing

A character string specifying the balancing method. One of "origins", "destinations", or "both".

max_dist

A numeric value specifying the maximum distance for interaction.

origins.id

A character string specifying the ID column in the origins sf object.

origins.size

A character string specifying the size column in the origins sf object.

destinations.id

A character string specifying the ID column in the destinations sf object.

destinations.size

A character string specifying the size column in the destinations sf object.

keep_cols

A logical value. If TRUE, all columns from the input data are kept. If FALSE (default), only O, D and the output_col are kept.

output_col

A character string specifying the name of the column for the modelled trips (default is "modelled_trips").

max_iter

An integer, the maximum number of iterations for the balancing algorithm (default is 25).

Value

An sf object with the modelled trips.

Examples

# sim_schools(origins, destinations, model = "gravity")