View source: R/spatial_availability.R
spatial_availability | R Documentation |
Calculates spatial availability, an accessibility measured proposed by \insertCitesoukhov2023introducing;textualaccessibility that takes into account competition effects. The accessibility levels that result from using this measure are proportional both to the demand in each origin and to the travel cost it takes to reach the destinations.
This function is generic over any kind of numeric travel cost, such as distance, time and money.
spatial_availability(
travel_matrix,
land_use_data,
opportunity,
travel_cost,
demand,
decay_function,
alpha = 1,
group_by = character(0),
fill_missing_ids = TRUE,
detailed_results = FALSE
)
travel_matrix |
A data frame. The travel matrix describing the costs
(i.e. travel time, distance, monetary cost, etc.) between the origins and
destinations in the study area. Must contain the columns |
land_use_data |
A data frame. The distribution of opportunities within
the study area cells. Must contain the columns |
opportunity |
A string. The name of the column in |
travel_cost |
A string. The name of the column in |
demand |
A string. The name of the column in |
decay_function |
A |
alpha |
A |
group_by |
A |
fill_missing_ids |
A |
detailed_results |
A |
A data frame containing the accessibility estimates for each
origin/destination (depending if active
is TRUE
or FALSE
) in the
travel matrix.
# the example below is based on Soukhov et al. (2023) paper
travel_matrix <- data.table::data.table(
from_id = rep(c("A", "B", "C"), each = 3),
to_id = as.character(rep(1:3, 3)),
travel_time = c(15, 30, 100, 30, 15, 100, 100, 100, 15)
)
land_use_data <- data.table::data.table(
id = c("A", "B", "C", "1", "2", "3"),
population = c(50000, 150000, 10000, 0, 0, 0),
jobs = c(0, 0, 0, 100000, 100000, 10000)
)
df <- spatial_availability(
travel_matrix,
land_use_data,
opportunity = "jobs",
travel_cost = "travel_time",
demand = "population",
decay_function = decay_exponential(decay_value = 0.1)
)
df
detailed_df <- spatial_availability(
travel_matrix,
land_use_data,
opportunity = "jobs",
travel_cost = "travel_time",
demand = "population",
decay_function = decay_exponential(decay_value = 0.1),
detailed_results = TRUE
)
detailed_df
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.