View source: R/assignation_exist.R
assignation_exist | R Documentation |
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
assignation_exist(pop, centers, d, crs, route = FALSE)
pop |
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 |
Return a LIST with:
new_centers |
Centers to cover the population |
new_assign |
Population with the center assigned |
assignation_exist(pop_epp, centers_epp, d = 1000, crs = sp::CRS("+init=epsg:32721"), route = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.