if (interactive()) {
library(r5r)
# build transport network
path <- system.file("extdata/spo", package = "r5r")
r5r_core <- setup_r5(data_path = path, temp_dir = TRUE)
# load origin/destination points
points <- read.csv(file.path(path, "spo_hexgrid.csv"))
# find where origin or destination points are snapped
snap_df <- find_snap(r5r_core,
points = points,
mode = 'CAR')
stop_r5(r5r_core)
}
Run the code above in your browser using DataLab