Description Usage Arguments Value Examples
View source: R/max_cov_relocation.R
This function adds a relocation step
1 2 3 | max_coverage_relocation(existing_facility = NULL, proposed_facility,
user, distance_cutoff, cost_install, cost_removal, cost_total,
solver = "lpSolve", return_early = FALSE)
|
existing_facility |
data.frame containing the facilities that are already in existing, with columns names lat, and long. |
proposed_facility |
data.frame containing the facilities that are being proposed, with column names lat, and long. |
user |
data.frame containing the users of the facilities, along with column names lat, and long. |
distance_cutoff |
numeric indicating the distance cutoff (in metres) you are interested in. If a number is less than distance_cutoff, it will be 1, if it is greater than it, it will be 0. |
cost_install |
integer the cost of installing a new facility |
cost_removal |
integer the cost of removing a facility |
cost_total |
integer the total cost allocated to the project |
solver |
character "glpk" (default) or "lpSolve". "gurobi" is currently in development, see https://github.com/njtierney/maxcovr/issues/25 |
return_early |
logical TRUE if I do not want to run the extraction process, FALSE if I want to just return the lpsolve model etc. |
dataframe of results
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## Not run:
library(dplyr)
# subset to be the places with towers built on them.
york_selected <- york %>% filter(grade == "I")
york_unselected <- york %>% filter(grade != "I")
# OK, what if I just use some really crazy small data to optimise over.
#
mc_relocate <- max_coverage_relocation(existing_facility = york_selected,
proposed_facility = york_unselected,
user = york_crime,
distance_cutoff = 100,
cost_install = 5000,
cost_removal = 200,
cost_total = 600000)
mc_relocate
summary(mc_relocate)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.