|
11 | 11 | #' list of unnamed elements, each element is either a numeric vector of lat/lon |
12 | 12 | #' coordinates, an address string or place_id, or a vector of a pair of lat / lon coordinates |
13 | 13 | #' @param mode \code{string} One of 'driving', 'walking', 'bicycling' or 'transit'. |
14 | | -#' @param departure_time a \code{POSIXct} time since 1st January 1970. |
15 | | -#' Specifies the desired time of departure. If no value |
16 | | -#' is specified it defaults to \code{Sys.time()} |
17 | | -#' @param arrival_time a \code{POSIXct} time since 1st January 1970. |
18 | | -#' Specifies the desired time of arrival. Note you |
19 | | -#' can only specify one of \code{arrival_time} or \code{departure_time}, not both. |
| 14 | +#' @param departure_time The desired time of departure. |
| 15 | +#' Use either a \code{POSIXct} time since 1st January 1970, or the string 'now'. |
| 16 | +#' If no value is specified it defaults to \code{Sys.time()}. |
| 17 | +#' @param arrival_time Specifies the desired time of arrival for transit requests. |
| 18 | +#' Use either a \code{POSIXct} time since 1st January 1970. |
| 19 | +#' Note you can only specify one of \code{arrival_time} or \code{departure_time}, not both. |
20 | 20 | #' If both are supplied, \code{departure_time} will be used. |
21 | 21 | #' @param waypoints list of waypoints, expressed as either \code{vectors} of |
22 | 22 | #' lat/lon coordinates, or a \code{string} address to be geocoded, or an encoded |
|
88 | 88 | #' units = "imperial", |
89 | 89 | #' simplify = TRUE) |
90 | 90 | #' |
| 91 | +#' ## using 'now' as departure time |
| 92 | +#' google_directions(origin = "Flinders Street Station, Melbourne", |
| 93 | +#' destination = "MCG, Melbourne", |
| 94 | +#' departure_time = 'now') |
| 95 | +#' |
91 | 96 | #' ## waypoints expressed as an encoded polyline |
92 | 97 | #' polyWaypoints <- encode_pl(tram_stops[1:2, c("stop_lat")], tram_stops[1:2, c("stop_lon")]) |
93 | 98 | #' polyWaypoints <- list(via = paste0("enc:", polyWaypoints, ":")) |
|
98 | 103 | #' |
99 | 104 | #' |
100 | 105 | #' ## using bus and less walking |
101 | | -#' google_directions(origin = "Melbourne Airport, Australia", |
| 106 | +#' res <- google_directions(origin = "Melbourne Airport, Australia", |
102 | 107 | #' destination = "Portsea, Melbourne, Australia", |
103 | 108 | #' departure_time = Sys.time() + (24 * 60 * 60), |
104 | 109 | #' mode = "transit", |
|
107 | 112 | #' simplify = FALSE) |
108 | 113 | #' |
109 | 114 | #' ## using arrival time |
110 | | -#' google_directions(origin = "Melbourne Airport, Australia", |
| 115 | +#' res <- google_directions(origin = "Melbourne Airport, Australia", |
111 | 116 | #' destination = "Portsea, Melbourne, Australia", |
112 | 117 | #' arrival_time = Sys.time() + (24 * 60 * 60), |
113 | 118 | #' mode = "transit", |
|
116 | 121 | #' simplify = FALSE) |
117 | 122 | #' |
118 | 123 | #' ## return results in French |
119 | | -#' google_directions(origin = "Melbourne Airport, Australia", |
| 124 | +#' res <- google_directions(origin = "Melbourne Airport, Australia", |
120 | 125 | #' destination = "Portsea, Melbourne, Australia", |
121 | 126 | #' arrival_time = Sys.time() + (24 * 60 * 60), |
122 | 127 | #' mode = "transit", |
|
0 commit comments