# NOT RUN {
library(mapboxapi)
library(sf)
to_visit <- data.frame(
X = c(-0.209307, -0.185875, -0.216877, -0.233511, -0.234541),
Y = c(5.556019, 5.58031, 5.582528, 5.566771, 5.550209)
) %>%
st_as_sf(coords = c("X", "Y"), crs = 4326)
optimized_route <- mb_optimized_route(to_visit,
profile = "driving-traffic")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab