# NOT RUN {
# Authentication
set_auth(
app_id = "<YOUR APP ID>",
app_code = "<YOUR APP CODE>"
)
# Real-time traffic flow
flow <- traffic(
aoi = aoi[aoi$code == "LI", ],
product = "flow",
url_only = TRUE
)
# All traffic incidents from 2018 till end of 2019
incidents <- traffic(
aoi = aoi[aoi$code == "LI", ],
product = "incidents",
from_dt = as.POSIXct("2018-01-01 00:00:00"),
to_dt = as.POSIXct("2019-12-31 23:59:59"),
url_only = TRUE
)
# }
Run the code above in your browser using DataLab