R/create_time_distance_n_by_cat_sf.R
create_time_distance_n_by_cat_sf.Rd
Creates sf of geometry type point for each source feature with the minimum distance and duration values to n nearest target features which match the applied category filter
create_time_distance_n_by_cat_sf(odm_object, filter_attribute, filter_value, n)
odm_object | of type list encompassing a duration and a distance
matrix, the source and target locations. Created by using either
|
---|---|
filter_attribute | A category column to subset the targets |
filter_value | A string with a specific category value |
n | An integer defining the number of minimum values to be incorporated |
sf object of geometry type point
calc_odm()
or calc_odm_multicore()
for odm_object
creation and create_time_distance_by_cat_sf
to calculate only
the nearest target location for a specific category
data(testdata) od_result <- testdata$od_result output_sf <- create_time_distance_n_by_cat_sf( odm_object = od_result, filter_attribute = "category", filter_value = "A", n = 3 )#>#> #> #>#>#> #> #>#>#>#>