Skip to content

Commit

Permalink
docs: switch assignment operator in examples from = to <-
Browse files Browse the repository at this point in the history
  • Loading branch information
aoles committed Sep 20, 2024
1 parent 9d66a65 commit 566bf2d
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 46 deletions.
2 changes: 1 addition & 1 deletion R/directions.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#' @template return-parsed
#' @template return-sf
#' @examples
#' coordinates = list(c(8.34234, 48.23424), c(8.34423, 48.26424))
#' coordinates <- list(c(8.34234, 48.23424), c(8.34423, 48.26424))
#'
#' # simple call
#' ors_directions(coordinates, preference="fastest")
Expand Down
2 changes: 0 additions & 2 deletions R/elevation.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#' @template return-parsed
#' @template return-sf
#' @examples
#'
#' # point coordinates
#' coordinates <- c(13.349762, 38.11295)
#' ors_elevation("point", coordinates)
Expand All @@ -32,7 +31,6 @@
#' c(12.638397, 37.645772)
#' )
#' ors_elevation("polyline", coordinates, format_out = "encodedpolyline")
#'
#' @template author
#' @importFrom httr add_headers
#' @export
Expand Down
15 changes: 6 additions & 9 deletions R/geocode.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,21 @@
#' tag which surrounds the given coordinate.
#' @template author
#' @examples
#'
#' ## locations of Heidelberg around the globe
#' x = ors_geocode("Heidelberg")
#'
#' ## set the number of results returne
#' x <- ors_geocode("Heidelberg")
#'
#' x = ors_geocode("Heidelberg", size = 1)
#' ## set the number of results returned
#' x <- ors_geocode("Heidelberg", size = 1)
#'
#' ## search within a particular country
#' ors_geocode("Heidelberg", boundary.country = "DE")
#'
#' ## structured geocoding
#' x = ors_geocode(list(locality="Heidelberg", county="Heidelberg"))
#' x <- ors_geocode(list(locality="Heidelberg", county="Heidelberg"))
#'
#' ## reverse geocoding
#' location = x$features[[1L]]$geometry$coordinates
#' y = ors_geocode(location = location, layers = "locality", size = 1)
#'
#' location <- x$features[[1L]]$geometry$coordinates
#' y <- ors_geocode(location = location, layers = "locality", size = 1)
#' @export
ors_geocode <- function(query,
location,
Expand Down
4 changes: 2 additions & 2 deletions R/matrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
#' @template return-text
#' @template return-parsed
#' @examples
#' coordinates = list(
#' coordinates <- list(
#' c(9.970093, 48.477473),
#' c(9.207916, 49.153868),
#' c(37.573242, 55.801281),
#' c(115.663757,38.106467)
#' )
#'
#' # query for duration and distance in km
#' res = ors_matrix(coordinates, metrics = c("duration", "distance"), units = "km")
#' res <- ors_matrix(coordinates, metrics = c("duration", "distance"), units = "km")
#'
#' # duration in hours
#' res$durations / 3600
Expand Down
4 changes: 2 additions & 2 deletions R/optimization.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#' @examples
#' home_base <- c(2.35044, 48.71764)
#'
#' vehicles = vehicles(
#' vehicles <- vehicles(
#' id = 1:2,
#' profile = "driving-car",
#' start = home_base,
Expand All @@ -37,7 +37,7 @@
#' c(2.89357, 48.90736)
#' )
#'
#' jobs = jobs(
#' jobs <- jobs(
#' id = 1:6,
#' service = 300,
#' amount = 1,
Expand Down
4 changes: 2 additions & 2 deletions R/pois.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#' ors_pois('list')
#'
#' # POIs around a buffered point
#' geometry = list(geojson = list(type = "Point",
#' coordinates = c(8.8034, 53.0756)),
#' geometry <- list(geojson = list(type = "Point",
#' coordinates = c(8.8034, 53.0756)),
#' buffer = 100)
#' ors_pois(geometry = geometry)
#'
Expand Down
7 changes: 3 additions & 4 deletions R/snap.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@
#' @template return-parsed
#' @template return-sf
#' @examples
#' locations = list(
#' locations <- list(
#' c(8.669629, 49.413025),
#' c(8.675841, 49.418532),
#' c(8.665144, 49.415594)
#' )
#'
#' # query for duration and distance in km
#' res = ors_snap(locations, radius = 350)
#'
#' # query for locations snapped onto the OpenStreetMap road network
#' res <- ors_snap(locations, radius = 350)
#' @template author
#' @export
ors_snap <- function(locations,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ allows you to painlessly consume the following services:
- [isochrones](https://openrouteservice.org/dev/#/api-docs/v2/isochrones/%7Bprofile%7D/post)
(accessibility)
- time-distance
[matrix](https://openrouteservice.org/dev/#/api-docs/v2/matrix/%7Bprofile%7D/post)
[matrices](https://openrouteservice.org/dev/#/api-docs/v2/matrix/%7Bprofile%7D/post)
- [snapping](https://openrouteservice.org/dev/#/api-docs/v2/snap/%7Bprofile%7D/post)
to ways
- [pois](https://openrouteservice.org/dev/#/api-docs/pois/post)
Expand Down
2 changes: 1 addition & 1 deletion man/ors_directions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions man/ors_elevation.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 6 additions & 9 deletions man/ors_geocode.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/ors_matrix.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/ors_optimization.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/ors_pois.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions man/ors_snap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vignettes/openrouteservice.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ to painlessly consume the following services:
- `r doc('directions')` (routing)
- `r doc('geocode', label='geocoding')` powered by [Pelias](https://pelias.io)
- `r doc('isochrones')` (accessibility)
- time-distance `r doc('matrix')`
- time-distance `r doc('matrix', label='matrices')`
- `r doc('snap', label='snapping')` to ways
- `r doc('pois')` (points of interest)
- SRTM `r doc('elevation')` for point and lines geometries
Expand Down

0 comments on commit 566bf2d

Please sign in to comment.