# Hansen accessibility for grocery stores in Freiburg:
data(Freiburg1)
# Distance matrix for grocery stores in Freiburg
data(Freiburg2)
# Statistical districs of Freiburg
hansen (Freiburg1, "district", "store", "salesarea", "distance", gamma = 1, lambda = -2)
# Computes the Hansen accessibility from the statistical districts of Freiburg
# regarding the grocery stores and their sizes
# Hansen accessibility for psychotherapists in South Lower Saxony:
data(health1)
# Health service locations in South Lower Saxony
data(health5)
# Distance matrix for health service locations and subregions in South Lower Saxony
psycho <- merge (health5, health1[health1$type == "psych",],
by.x = "location_to", by.y = "location")
# Extracting psychotherapists
psycho <- psycho[sample(nrow(psycho), 10), ]
# Random sample of 10 rows (psychotherapists)
hansen_psych <- hansen(psycho, "region_from", "location_to", attrac = 1,
"drvtime", lambda = -0.11, dtype = "exp", dist_const = 5)
# Hansen accessibility for psychotherapists with an exponential distance decay function
# with a weighting of lambda = -0.11
Run the code above in your browser using DataLab