assignation_exist: Function to assign population to centers of services
Description
Function to assign population to centers of services, based in proximity, maximum radius and nominal capacity of the centers. The capacity and maximum radius are defined a priori based on policies' objectives
Population to attend (dataframe with three variables: x, y, and weight). x and y are plain coordinates in the defined CRS
centers
Centers of services (dataframe with four variables: x, y, id, and capacity) x and y are plain coordinates in the defined CRS
d
Maximum distance at which the center may provide service in meters
crs
Coordinates reference system of pop and centers
route
logical if FALSE the distance is calculated by Pythagorean formula, if TRUE the distance is calculated by "osrmRoute" function of "osrm" Package. Default = FALSE