assignation_exist: Function to assign population to centers of services

View source: R/assignation_exist.R

assignation_existR Documentation

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

Usage

assignation_exist(pop, centers, d, crs, route = FALSE)

Arguments

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

Value

Return a LIST with:

new_centers

Centers to cover the population

new_assign

Population with the center assigned

Examples

assignation_exist(pop_epp, centers_epp, d = 1000, crs = sp::CRS("+init=epsg:32721"), route = FALSE)

RichDeto/EPP documentation built on May 5, 2022, 10:23 p.m.