assign_place_coords: Assign a place with long/lat coords to a synthetic population

Description Usage Arguments Value

View source: R/places.R

Description

Assign a place with long/lat coords to a synthetic population

Usage

1
2
assign_place_coords(pop, places, place_name = "place", method = "uniform",
  dist_fxn = euclidean_dist, cap_fxn = cap_default)

Arguments

pop

data frame with "longitude" and "latitude" columns

places

data frame with "longitude" and "latitude" and an "ID" column, perhaps a "capacity" column

place_name

string that will become the column name of the place

method

c("uniform", "capacity") The method on how we assign places. The "uniform" argument means that we do not consider capacity in assignments, only distance. Conversely, "capacity" means we do consider capacity when assigning agents to places. The default is "uniform".

dist_fxn

a function with args x1, y1, x2, y2 that returns a single number. The default is Euclidean Distance $d((x1, y1), (x2,y2) = sqrt( x1-x2)^2 + (y1 - y2)^2 ). The distance should satisfy the requirements of a metric.

cap_fxn

a function with one argument, a single capacity. This should be a monotone increasing function. The default is cap_default.

Value

data frame with column of place_name with the place_ids, e.g. assignments of the places to the agents.


leerichardson/spew documentation built on May 21, 2019, 1:39 a.m.