View source: R/grvty_balancing.R
| grvty_balancing | R Documentation |
Calculate balancing factors for gravity model
grvty_balancing( od_zones, friction, zone_id, zone_o, zone_d, friction_o_id, friction_d_id, friction_factor, tolerance, max_iter )
od_zones |
A data frame with origins and destinations |
friction |
A data frame with friction factors for each O-D pair |
zone_id |
Name of ID column in od_zones |
zone_o |
Name of origins column in od_zones |
zone_d |
Name of destinations column in od_zones |
friction_o_id |
Name of column with origin ID in friction |
friction_d_id |
Name of column with destination ID in friction |
friction_factor |
Name of column with friction factor in friction |
tolerance |
Acceptable error (number of trips) |
max_iter |
Maximum number of iterations |
A list of two data frames, one with the flows and one with convergence data
result <- grvty_balancing(od_zones = salt_lake_zones,
friction = salt_lake_friction,
zone_id = "GEOID",
zone_o = "hbo_prod",
zone_d = "hbo_attr_bal",
friction_o_id = "fromId",
friction_d_id = "toId",
friction_factor = "F_HBO",
tolerance = 0.01,
max_iter = 100000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.