Skip to content

Commit

Permalink
Remove dontrun in exemples that don't require authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaspons committed Jul 15, 2024
1 parent 7ea4f5d commit f79849a
Show file tree
Hide file tree
Showing 25 changed files with 0 additions and 68 deletions.
2 changes: 0 additions & 2 deletions R/osm_get_changesets.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,9 @@
#' @export
#'
#' @examples
#' \dontrun{
#' chaset <- osm_get_changesets(changeset_id = 137595351, include_discussion = TRUE)
#' chaset
#' chaset$discussion
#' }
osm_get_changesets <- function(changeset_id, include_discussion = FALSE,
format = c("R", "sf", "xml", "json"), tags_in_columns = FALSE) {
format <- match.arg(format)
Expand Down
2 changes: 0 additions & 2 deletions R/osm_get_gpx_metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@
#' @export
#'
#' @examples
#' \dontrun{
#' trk_meta <- osm_get_gpx_metadata(gpx_id = 3498170)
#' trk_meta
#' }
osm_get_gpx_metadata <- function(gpx_id, format = c("R", "sf", "xml")) {
format <- match.arg(format)
.format <- if (format == "sf") "R" else format
Expand Down
2 changes: 0 additions & 2 deletions R/osm_get_notes.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,8 @@
#' @export
#'
#' @examples
#' \dontrun{
#' note <- osm_get_notes(note_id = "2067786")
#' note
#' }
osm_get_notes <- function(note_id, format = c("R", "sf", "xml", "rss", "json", "gpx")) {
format <- match.arg(format)
.format <- if (format == "sf") "R" else format
Expand Down
2 changes: 0 additions & 2 deletions R/osm_get_objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@
#' @export
#'
#' @examples
#' \dontrun{
#' obj <- osm_get_objects(
#' osm_type = c("node", "way", "way", "relation", "relation", "node"),
#' osm_id = c("35308286", "13073736", "235744929", "40581", "341530", "1935675367"),
#' version = c(1, 3, 2, 5, 7, 1)
#' )
#' obj
#' }
osm_get_objects <- function(osm_type, osm_id, version, full_objects = FALSE,
format = c("R", "xml", "json"), tags_in_columns = FALSE) {
format <- match.arg(format)
Expand Down
2 changes: 0 additions & 2 deletions R/osm_get_user_details.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@
#' @export
#'
#' @examples
#' \dontrun{
#' usrs <- osm_get_user_details(user_id = c(1, 24, 44, 45, 46, 48, 49, 50))
#' usrs
#' }
osm_get_user_details <- function(user_id, format = c("R", "xml", "json")) {
format <- match.arg(format)

Expand Down
2 changes: 0 additions & 2 deletions R/osm_query_changesets.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
#' @export
#'
#' @examples
#' \dontrun{
#' chst_ids <- osm_query_changesets(changeset_ids = c(137627129, 137625624))
#' chst_ids
#'
Expand All @@ -109,7 +108,6 @@
#' closed = TRUE
#' )
#' chsts2
#' }
osm_query_changesets <- function(bbox, user, time, time_2, open, closed, changeset_ids, order = c("newest", "oldest"),
limit = getOption("osmapir.api_capabilities")$api$changesets["default_query_limit"],
format = c("R", "sf", "xml", "json"), tags_in_columns = FALSE) {
Expand Down
6 changes: 0 additions & 6 deletions R/osmapi_changesets.R
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,9 @@ osm_create_changeset <- function(comment, ...,
#' @noRd
#'
#' @examples
#' \dontrun{
#' chaset <- osm_read_changeset(changeset_id = 137595351, include_discussion = TRUE)
#' chaset
#' chaset$discussion
#' }
osm_read_changeset <- function(changeset_id, include_discussion = FALSE,
format = c("R", "xml", "json"), tags_in_columns = FALSE) {
format <- match.arg(format)
Expand Down Expand Up @@ -455,10 +453,8 @@ osm_close_changeset <- function(changeset_id) {
#' @export
#'
#' @examples
#' \dontrun{
#' chaset <- osm_download_changeset(changeset_id = 137003062)
#' chaset
#' }
osm_download_changeset <- function(changeset_id, format = c("R", "osc", "xml")) {
format <- match.arg(format)

Expand Down Expand Up @@ -617,7 +613,6 @@ osm_download_changeset <- function(changeset_id, format = c("R", "osc", "xml"))
#' @noRd
#'
#' @examples
#' \dontrun{
#' chst_ids <- osm_query_changesets(changeset_ids = c(137627129, 137625624))
#' chst_ids
#'
Expand All @@ -635,7 +630,6 @@ osm_download_changeset <- function(changeset_id, format = c("R", "osc", "xml"))
#' closed = "true"
#' )
#' chsts2
#' }
.osm_query_changesets <- function(bbox = NULL, user = NULL, time = NULL, time_2 = NULL, open = NULL, closed = NULL,
changeset_ids = NULL, order = NULL,
limit = getOption(
Expand Down
10 changes: 0 additions & 10 deletions R/osmapi_elements.R
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ osm_create_object <- function(x, changeset_id) {
#' @noRd
#'
#' @examples
#' \dontrun{
#' node <- osm_read_object(osm_type = "node", osm_id = 35308286)
#' node
#'
Expand All @@ -222,7 +221,6 @@ osm_create_object <- function(x, changeset_id) {
#'
#' rel <- osm_read_object(osm_type = "relation", osm_id = "40581")
#' rel
#' }
osm_read_object <- function(osm_type = c("node", "way", "relation"),
osm_id, format = c("R", "xml", "json"), tags_in_columns = FALSE) {
osm_type <- match.arg(osm_type)
Expand Down Expand Up @@ -553,7 +551,6 @@ osm_delete_object <- function(x, changeset_id) {
#' @export
#'
#' @examples
#' \dontrun{
#' node <- osm_history_object(osm_type = "node", osm_id = 35308286)
#' node
#'
Expand All @@ -562,7 +559,6 @@ osm_delete_object <- function(x, changeset_id) {
#'
#' rel <- osm_history_object(osm_type = "relation", osm_id = "40581")
#' rel
#' }
osm_history_object <- function(osm_type = c("node", "way", "relation"), osm_id,
format = c("R", "xml", "json"), tags_in_columns = FALSE) {
osm_type <- match.arg(osm_type)
Expand Down Expand Up @@ -624,7 +620,6 @@ osm_history_object <- function(osm_type = c("node", "way", "relation"), osm_id,
#' @noRd
#'
#' @examples
#' \dontrun{
#' node <- osm_version_object(osm_type = "node", osm_id = 35308286, version = 1)
#' node
#'
Expand All @@ -633,7 +628,6 @@ osm_history_object <- function(osm_type = c("node", "way", "relation"), osm_id,
#'
#' rel <- osm_version_object(osm_type = "relation", osm_id = "40581", version = 3)
#' rel
#' }
osm_version_object <- function(osm_type = c("node", "way", "relation"), osm_id, version,
format = c("R", "xml", "json"), tags_in_columns = FALSE) {
osm_type <- match.arg(osm_type)
Expand Down Expand Up @@ -710,7 +704,6 @@ osm_version_object <- function(osm_type = c("node", "way", "relation"), osm_id,
#' @noRd
#'
#' @examples
#' \dontrun{
#' node <- osm_fetch_objects(osm_type = "nodes", osm_ids = c(35308286, 1935675367))
#' node
#'
Expand All @@ -720,7 +713,6 @@ osm_version_object <- function(osm_type = c("node", "way", "relation"), osm_id,
#' # Specific versions
#' rel <- osm_fetch_objects(osm_type = "relations", osm_ids = c("40581", "341530"), versions = c(3, 1))
#' rel
#' }
osm_fetch_objects <- function(osm_type = c("nodes", "ways", "relations"), osm_ids, versions,
format = c("R", "xml", "json"), tags_in_columns = FALSE) {
osm_type <- match.arg(osm_type)
Expand Down Expand Up @@ -1010,13 +1002,11 @@ osm_ways_node <- function(node_id, format = c("R", "xml", "json"), tags_in_colum
#' @noRd
#'
#' @examples
#' \dontrun{
#' way <- osm_full_object(osm_type = "way", osm_id = 13073736)
#' way
#'
#' rel <- osm_full_object(osm_type = "relation", osm_id = "40581")
#' rel
#' }
osm_full_object <- function(osm_type = c("way", "relation"), osm_id,
format = c("R", "xml", "json"), tags_in_columns = FALSE) {
osm_type <- match.arg(osm_type)
Expand Down
4 changes: 0 additions & 4 deletions R/osmapi_gps_traces.R
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,8 @@ osm_update_gpx <- function(gpx_id, name, description, tags,
#' @noRd
#'
#' @examples
#' \dontrun{
#' trk_meta <- osm_get_metadata_gpx(gpx_id = 3498170)
#' trk_meta
#' }
osm_get_metadata_gpx <- function(gpx_id, format = c("R", "xml")) {
format <- match.arg(format)
req <- osmapi_request(authenticate = TRUE)
Expand Down Expand Up @@ -393,14 +391,12 @@ osm_get_metadata_gpx <- function(gpx_id, format = c("R", "xml")) {
#' @export
#'
#' @examples
#' \dontrun{
#' trk_data <- osm_get_data_gpx(gpx_id = 3498170, format = "R")
#' trk_data
#'
#' ## get attributes
#' attr(trk_data, "track")
#' attr(trk_data, "gpx_attributes")
#' }
osm_get_data_gpx <- function(gpx_id, format) {
if (missing(format)) {
ext <- "data"
Expand Down
2 changes: 0 additions & 2 deletions R/osmapi_map_notes.R
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,8 @@ osm_read_bbox_notes <- function(bbox, limit = 100, closed = 7, format = c("R", "
#' @noRd
#'
#' @examples
#' \dontrun{
#' note <- osm_read_note(note_id = "2067786")
#' note
#' }
osm_read_note <- function(note_id, format = c("R", "xml", "rss", "json", "gpx")) {
format <- match.arg(format)

Expand Down
4 changes: 0 additions & 4 deletions R/osmapi_user_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,8 @@
#' @noRd
#'
#' @examples
#' \dontrun{
#' usr <- osm_details_user(user_id = "11725140")
#' usr
#' }
osm_details_user <- function(user_id, format = c("R", "xml", "json")) {
format <- match.arg(format)

Expand Down Expand Up @@ -225,10 +223,8 @@ osm_details_user <- function(user_id, format = c("R", "xml", "json")) {
#' @noRd
#'
#' @examples
#' \dontrun{
#' usrs <- osm_details_users(user_ids = c(1, 24, 44, 45, 46, 48, 49, 50))
#' usrs
#' }
osm_details_users <- function(user_ids, format = c("R", "xml", "json")) {
format <- match.arg(format)

Expand Down
4 changes: 0 additions & 4 deletions R/osmchange.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@
#' @export
#'
#' @examples
#' \dontrun{
#' obj <- osm_get_objects(
#' osm_type = c("node", "way", "way", "relation", "relation", "node"),
#' osm_id = c("35308286", "13073736", "235744929", "40581", "341530", "1935675367"),
#' version = c(1, 3, 2, 5, 7, 1) # Old versions
#' )
#' osmch <- osmchange_modify(obj)
#' osmch
#' }
osmchange_modify <- function(x, tag_keys, members = FALSE, lat_lon = FALSE, format = c("R", "osc", "xml")) {
format <- match.arg(format)
stopifnot(inherits(x, "osmapi_objects"))
Expand Down Expand Up @@ -149,13 +147,11 @@ osmchange_modify <- function(x, tag_keys, members = FALSE, lat_lon = FALSE, form
#' @export
#'
#' @examples
#' \dontrun{
#' obj_id <- osmapi_objects(data.frame(
#' type = c("way", "way", "relation", "node"),
#' id = c("722379703", "629132242", "8387952", "4739010921")
#' ))
#' osmchange_del <- osmchange_delete(obj_id)
#' }
osmchange_delete <- function(x, delete_if_unused = FALSE, format = c("R", "osc", "xml")) {
format <- match.arg(format)

Expand Down
2 changes: 0 additions & 2 deletions R/tags_list-wide.r
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#' @export
#'
#' @examples
#' \dontrun{
#' peaks_wide <- osm_get_objects(
#' osm_type = "nodes", osm_id = c(35308286, 1935675367), tags_in_columns = TRUE
#' )
Expand All @@ -41,7 +40,6 @@
#' cities_list <- osm_get_objects(osm_type = "relations", osm_id = c("40581", "341530"))
#' # Column name clash:
#' cities_wide <- tags_list2wide(cities_list)
#' }
tags_list2wide <- function(x) {
if (!inherits(x, "osmapi_objects") && !inherits(x, "osmapi_changesets")) {
stop("x must be an `osmapi_objects` or `osmapi_changesets` object.")
Expand Down
2 changes: 0 additions & 2 deletions man/osm_download_changeset.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/osm_get_changesets.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/osm_get_data_gpx.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/osm_get_gpx_metadata.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/osm_get_notes.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/osm_get_objects.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/osm_get_user_details.Rd

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

Loading

0 comments on commit f79849a

Please sign in to comment.