I am attempting to give a series of routes to gmapsdistance function. This has previously worked fine with other routes but is not accepting the departure_time arguments with this combination of lat and long.
I have attempted simply entering in a future time in character format ("20:00:00") but get the same error.
route_1 <- c(c(57.14748,-2.0954), c(51.12788,-4.25714))
route_2 <- c(c(55.81875,-4.02555), c(51.4721,-0.45273))
route_3 <- c(c(54.96566,-5.0152), c(55.86568,-4.25714))
route_4 <- c(c(51.12788,-4.25714), c(51.38867,0.193838))
route_5 <- c(c(55.86568,-4.25714), c(51.12788,-4.25714))
route_6 <- c(c(51.4721,-0.45273), c(51.12788,-4.25714))
result <- gmapsdistance(origin = route_6[[1]], route_6[[2]],
destination = route_6[[3]], route_6[[4]],
traffic_model = "pessimistic",
mode = "driving",
dep_date = as.character(Sys.Date()),
dep_time = as.character(Sys.time() + 60*10),
key=key,
combinations = "all",
avoid = "")``
Error received is strangely:
The departure time has to be some time in the future!