ipeaGIT / accessibility

Calculate accessibility measures in R
https://ipeagit.github.io/accessibility/
Other
52 stars 9 forks source link

Allow for multiple cutoffs in `cumulative_time_cutoff()` #18

Closed rafapereirabr closed 1 year ago

rafapereirabr commented 2 years ago

The cutoff parameter cumulative_time_cutoff() currently has to be of length 1. It would be nice to allow users to pass a vector with multiple cutoff values, like in the example below

# load a travel time matrix data in long format
data_path <- system.file("extdata/ttm_bho.rds", package = "accessibility")
ttm <- readRDS(data_path)

my_cutoffs <- c(20, 30, 40, 60)

# Active accessibility: number of schools accessible from each origin
df <- cumulative_time_cutoff(data = ttm,
                           cutoff = my_cutoffs,
                           opportunity_col = 'schools',
                           travel_cost_col = 'travel_time',
                           by_col = 'from_id')
dhersz commented 1 year ago

Closing this in favor of https://github.com/ipeaGIT/accessibility/issues/19.