if (interactive()) {
# First, build the r5r network
library(r5r)
# Note: This requires a valid r5r network.
# Using the sample data included in the r5r package:
data_path <- system.file("extdata/poa", package = "r5r")
r5r_network <- setup_r5(data_path = data_path)
# Launch the application without specifying center and zoom
# The map will be automatically centered and zoomed to the network's extent
r5r_gui(r5r_network)
# Launch with a specific departure date with auto-zoom and center
r5r_gui(r5r_network, departure_date = as.Date("2019-05-13"))
# Launch with specific transport modes
r5r_gui(r5r_network, mode = c("WALK", "BUS"))
# Manually define map center and zoom
map_center <- c(-51.22, -30.05)
map_zoom <- 11
r5r_gui(r5r_network, center = map_center, zoom = map_zoom)
# Compare two networks
# Note: For this example, we use the same network object twice.
# In a real scenario, you would use two different networks (e.g. current vs future).
r5r_gui(list("Baseline" = r5r_network, "Scenario A" = r5r_network))
}
Run the code above in your browser using DataLab