View source: R/cumulative_interval.R
cumulative_interval | R Documentation |
Calculates the average or median number of opportunities that can be reached considering multiple maximum travel cost thresholds within a given travel cost interval specified by the user. The time interval cumulative accessibility measures was originally proposed by \insertCitetomasiello2023time;textualaccessibility.
This function is generic over any kind of numeric travel cost, such as distance, time and money.
cumulative_interval(
travel_matrix,
land_use_data,
opportunity,
travel_cost,
interval,
interval_increment = 1,
summary_function = stats::median,
group_by = character(0),
active = TRUE
)
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 |
interval |
A |
interval_increment |
A |
summary_function |
A function. This function is used to summarize a
distribution of accessibility estimates within a travel cost interval as a
single value. Can be any function that takes an arbitrary number of
numeric values as as input and returns a single number as output. Defaults
to |
group_by |
A |
active |
A logical. Whether to calculate active accessibility (the of opportunities that can be reached from a given origin, the default) or passive accessibility (by how many people each destination can be reached). |
A data frame containing the accessibility estimates for each
origin/destination (depending if active
is TRUE
or FALSE
) in the
travel matrix.
Other cumulative access:
cumulative_cutoff()
data_dir <- system.file("extdata", package = "accessibility")
travel_matrix <- readRDS(file.path(data_dir, "travel_matrix.rds"))
land_use_data <- readRDS(file.path(data_dir, "land_use_data.rds"))
df <- cumulative_interval(
travel_matrix = travel_matrix,
land_use_data = land_use_data,
interval = c(20, 30),
opportunity = "schools",
travel_cost = "travel_time"
)
head(df)
df <- cumulative_interval(
travel_matrix = travel_matrix,
land_use_data = land_use_data,
interval = c(40, 80),
opportunity = "jobs",
travel_cost = "travel_time"
)
head(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.