Reduce multiple travel times to a set of percentile values

reduce_to_percentiles(x, percentiles = c(5, 25, 50, 75, 95))

# S3 method for data.table
reduce_to_percentiles(x, percentiles = c(5, 25, 50, 75, 95))

# S3 method for stars
reduce_to_percentiles(x, percentiles = c(5, 25, 50, 75, 95))

Arguments

x

Object to reduce. May be a travel time grid as object of class stars created by create_traveltime_grid() and having multiple travel time values per spatial location stored along a third dimension. May also be an object of class data.table created by multinet_traveltimes() and having multiple travel time columns with names starting with "travel_time".

percentiles

Percentile values that should be calculated.

Value

In case x is a travel time grid: the updated travel time grid as object of class stars, with the third dimension now having one coordinate per calculated percentile value. The original third dimension is removed. In case x is a data table: the updated table having one travel time column per calculated percentile, all named "travel_time_p" followed by the corresponding percentile value. The original travel time columns are removed.