# load data
data("hospital")
# Compute potentials
pot <- quickStewart(x = hospital,
var = "capacity",
span = 1000,
beta = 2, mask = paris,
returnclass = "sf")
# cartography
if(require("cartography")){
breaks <- sort(c(unique(pot$min), max(pot$max)), decreasing = FALSE)
choroLayer(x = pot,
var = "center", breaks = breaks,
legend.pos = "topleft",
legend.title.txt = "Nb. of Beds")
}
# Compute a ratio of potentials
hospital$dummy <- hospital$capacity + c(rep(50, 18))
pot2 <- quickStewart(x = hospital,
var = "capacity",
var2 = "dummy",
span = 1000,
beta = 2,
mask = paris,
returnclass = "sf")
# cartography
if(require("cartography")){
breaks <- sort(c(unique(pot2$min), max(pot2$max)), decreasing = FALSE)
choroLayer(x = pot2,
var = "center", breaks = breaks,
legend.pos = "topleft",legend.values.rnd = 3,
legend.title.txt = "Nb. of DummyBeds")
}
Run the code above in your browser using DataLab