diff --git a/DESCRIPTION b/DESCRIPTION index d32a2f6..a86d0c7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: arcgislayers Type: Package -Title: An R Interface for ArcGIS Data Services +Title: An Interface to ArcGIS Data Services Version: 0.2.0 Authors@R: c( person("Josiah", "Parry", , "josiah.parry@gmail.com", role = c("aut", "cre"), @@ -14,7 +14,8 @@ Authors@R: c( ) Description: Enables users of 'ArcGIS Enterprise', 'ArcGIS Online', or 'ArcGIS Platform' to read, write, publish, or manage vector and raster - data via ArcGIS location services REST API endpoints. + data via ArcGIS location services REST API endpoints + . License: Apache License (>= 2) Encoding: UTF-8 LazyData: true diff --git a/R/add_item.R b/R/add_item.R index 11b1a60..692dae6 100644 --- a/R/add_item.R +++ b/R/add_item.R @@ -43,17 +43,17 @@ #' @export #' @rdname publish #' @examples -#' if (interactive()) { +#' \dontrun{ #' nc <- sf::st_read(system.file("shape/nc.shp", package = "sf")) #' x <- nc[1:5, 13] #' #' token <- auth_code() -#' set_arc_token(tkn) +#' set_arc_token(token) #' #' publish_res <- publish_layer( #' x, "North Carolina SIDS sample" #' ) -#' } +#'} #' @returns #' A named list containing the url of the newly published service. add_item <- function( diff --git a/R/arc-add-update-delete.R b/R/arc-add-update-delete.R index 4671e6f..a373d85 100644 --- a/R/arc-add-update-delete.R +++ b/R/arc-add-update-delete.R @@ -31,7 +31,7 @@ #' @export #' @rdname modify #' @examples -#' if (interactive()) { +#' \dontrun { #' # this is pseudo-code and will not work #' flayer <- arc_open(furl) #' diff --git a/R/arc-open.R b/R/arc-open.R index 2d7506d..11d5fcd 100644 --- a/R/arc-open.R +++ b/R/arc-open.R @@ -17,7 +17,7 @@ #' Depending on the provided URL returns a `FeatureLayer`, `Table`, `FeatureServer`, `ImageServer`, or `MapServer`. Each of these objects is a named list containing the properties of the service. #' @examples #' -#'if (interactive()) { +#' \dontrun { #' # FeatureLayer #' furl <- paste0( #' "https://services3.arcgis.com/ZvidGQkLaDJxRSJ2/arcgis/rest/services/", diff --git a/R/arc-raster.R b/R/arc-raster.R index 93c3a31..882d6e1 100644 --- a/R/arc-raster.R +++ b/R/arc-raster.R @@ -21,7 +21,7 @@ #' `r lifecycle::badge("experimental")` #' #' @examples -#' if (interactive()) { +#' \dontrun { #' img_url <- "https://landsat2.arcgis.com/arcgis/rest/services/Landsat/MS/ImageServer" #' #' landsat <- arc_open(img_url) diff --git a/R/arc-read.R b/R/arc-read.R index b1fd759..faf5f4c 100644 --- a/R/arc-read.R +++ b/R/arc-read.R @@ -28,7 +28,7 @@ #' `FeatureLayer` or `Table` or [arc_raster()] if URL is an `ImageLayer`. #' @returns An sf object, a `data.frame`, or an object of class `SpatRaster`. #' @examples -#' if (interactive()) { +#' \dontrun { #' furl <- "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census#' /MapServer/3" #' #' # read entire service diff --git a/R/arc-select.R b/R/arc-select.R index 04b772c..961bf49 100644 --- a/R/arc-select.R +++ b/R/arc-select.R @@ -41,7 +41,7 @@ #' #' @export #' @examples -#' if (interactive()) { +#' \dontrun { #' # define the feature layer url #' furl <- paste0( #' "https://services3.arcgis.com/ZvidGQkLaDJxRSJ2/arcgis/rest", @@ -378,7 +378,7 @@ check_inherits_any <- function(x, #' @param ... key value pairs of query parameters and values. #' @export #' @examples -#' if (interactive()) { +#' \dontrun { #' furl <- paste0( #' "https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/", #' "USA_Major_Cities_/FeatureServer/0" diff --git a/R/create-service.R b/R/create-service.R index 6a3d827..027fb88 100644 --- a/R/create-service.R +++ b/R/create-service.R @@ -29,12 +29,10 @@ #' #' @export #' @examples -#' \donttest{ -#' if (interactive()) { +#' \dontrun { #' set_arc_token(auth_code()) #' create_feature_server("My empty feature server") #' } -#' } create_feature_server <- function( service_name, description = "", diff --git a/R/truncate.R b/R/truncate.R index 8bb8836..7015f1f 100644 --- a/R/truncate.R +++ b/R/truncate.R @@ -15,8 +15,7 @@ #' @returns a named list with the name "success" and a value of `TRUE` or `FALSE` #' #' @examples -#' \donttest{ -#' if (interactive()) { +#' \dontrun { #' #' # authorize using code flow #' set_arc_token(auth_code()) @@ -27,7 +26,6 @@ #' # truncate it #' truncate_layer(flayer) #' } -#' } #' @export truncate_layer <- function( x, diff --git a/R/utils-feature-server.R b/R/utils-feature-server.R index 4bdf0c4..1a4809f 100644 --- a/R/utils-feature-server.R +++ b/R/utils-feature-server.R @@ -22,7 +22,7 @@ #' #' @export #' @examples -#' if (interactive()) { +#' \dontrun { #' # FeatureServer #' furl <- paste0( #' "https://services3.arcgis.com/ZvidGQkLaDJxRSJ2/arcgis/rest/services/", diff --git a/R/utils.R b/R/utils.R index df1f7dd..7a14b71 100644 --- a/R/utils.R +++ b/R/utils.R @@ -16,7 +16,7 @@ #' @export #' @rdname utils #' @examples -#' if (interactive()) { +#' \dontrun { #' furl <- paste0( #' "https://services3.arcgis.com/ZvidGQkLaDJxRSJ2/arcgis/rest/services/", #' "PLACES_LocalData_for_BetterHealth/FeatureServer/0" diff --git a/cran-comments.md b/cran-comments.md index 0d31540..27df3bd 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -3,6 +3,8 @@ 0 errors | 0 warnings | 1 note * This is a new release. -* This package imports arcgisutils 0.2.0 which was published on CRAN yesterday and may not have binaries for all distributions. -* ArcGIS is a brand name and not a software name which is why it is unquoted in the DESCRIPTION's description in "ArcGIS location services" and title. + +* ArcGIS is a brand name and not a software name which is why it is unquoted some places in the DESCRIPTION's. These being the `Title` field and in the `Description` where it says "ArcGIS location services." * REST is not a software but an architecture so it is not quoted. +* Removed R from the title per request +* Replaced instances of `if (interactive())` with `\dontrun{}`. All of these examples require an authorization token that is generated interactively as well as modifies remote data sources. As such diff --git a/dev/test-publishing.R b/dev/test-publishing.R index 9c992ce..37a874b 100644 --- a/dev/test-publishing.R +++ b/dev/test-publishing.R @@ -1,11 +1,11 @@ -set_auth_token(auth_code()) +set_arc_token(auth_code()) # PUBLISHING NON 3857 CRS does not work. x <- .data <- sf::st_set_crs(sfdep::guerry[10:22,3], 27572) debugonce(add_item) -publish_layer(x, "Poly 27572") +publish_layer(x, "Poly 2572") diff --git a/man/arc_open.Rd b/man/arc_open.Rd index 2921336..52824c9 100644 --- a/man/arc_open.Rd +++ b/man/arc_open.Rd @@ -26,7 +26,7 @@ To extract data from the remote resource utilize \code{\link[=arc_select]{arc_se } \examples{ -if (interactive()) { +\dontrun { # FeatureLayer furl <- paste0( "https://services3.arcgis.com/ZvidGQkLaDJxRSJ2/arcgis/rest/services/", diff --git a/man/arc_raster.Rd b/man/arc_raster.Rd index ac17b00..1d0866e 100644 --- a/man/arc_raster.Rd +++ b/man/arc_raster.Rd @@ -53,7 +53,7 @@ See \code{\link[terra:rast]{terra::rast}}. \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} } \examples{ -if (interactive()) { +\dontrun { img_url <- "https://landsat2.arcgis.com/arcgis/rest/services/Landsat/MS/ImageServer" landsat <- arc_open(img_url) diff --git a/man/arc_read.Rd b/man/arc_read.Rd index 226c1d5..0fe6eaf 100644 --- a/man/arc_read.Rd +++ b/man/arc_read.Rd @@ -62,7 +62,7 @@ names for the returned data frame or sf object using the \code{col_names} and \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} } \examples{ -if (interactive()) { +\dontrun { furl <- "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census#' /MapServer/3" # read entire service diff --git a/man/arc_select.Rd b/man/arc_select.Rd index 5723cd9..f60122b 100644 --- a/man/arc_select.Rd +++ b/man/arc_select.Rd @@ -76,7 +76,7 @@ avoid time outs. \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} } \examples{ -if (interactive()) { +\dontrun { # define the feature layer url furl <- paste0( "https://services3.arcgis.com/ZvidGQkLaDJxRSJ2/arcgis/rest", diff --git a/man/create_feature_server.Rd b/man/create_feature_server.Rd index 4fa5569..b2b06c9 100644 --- a/man/create_feature_server.Rd +++ b/man/create_feature_server.Rd @@ -62,10 +62,8 @@ Creates an empty FeatureServer with no additional layers. \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} } \examples{ -\donttest{ -if (interactive()) { +\dontrun { set_arc_token(auth_code()) create_feature_server("My empty feature server") } } -} diff --git a/man/get_layer.Rd b/man/get_layer.Rd index c32ed0a..667f559 100644 --- a/man/get_layer.Rd +++ b/man/get_layer.Rd @@ -39,7 +39,7 @@ These helpers provide easy access to the layers contained in a The \code{id} and \code{name} arguments must match the field values of the respective names as seen in the output of \code{list_items()} } \examples{ -if (interactive()) { +\dontrun { # FeatureServer furl <- paste0( "https://services3.arcgis.com/ZvidGQkLaDJxRSJ2/arcgis/rest/services/", diff --git a/man/modify.Rd b/man/modify.Rd index 2be9fb2..3176b7c 100644 --- a/man/modify.Rd +++ b/man/modify.Rd @@ -90,7 +90,7 @@ remains \code{"Sepal.Length"}. For that reason, we match on the alias name by de Change this argument to match based on the field name. } \examples{ -if (interactive()) { +\dontrun { # this is pseudo-code and will not work flayer <- arc_open(furl) diff --git a/man/publish.Rd b/man/publish.Rd index c5fe79e..a13cf5d 100644 --- a/man/publish.Rd +++ b/man/publish.Rd @@ -120,12 +120,12 @@ provided to \code{target_crs} matches that of the item you added with } } \examples{ -if (interactive()) { +\dontrun{ nc <- sf::st_read(system.file("shape/nc.shp", package = "sf")) x <- nc[1:5, 13] token <- auth_code() - set_arc_token(tkn) + set_arc_token(token) publish_res <- publish_layer( x, "North Carolina SIDS sample" diff --git a/man/truncate_layer.Rd b/man/truncate_layer.Rd index 4242937..6f0a77f 100644 --- a/man/truncate_layer.Rd +++ b/man/truncate_layer.Rd @@ -27,8 +27,7 @@ counter. Truncating a Feature Layer does not change the schema of the data or indexes). } \examples{ -\donttest{ -if (interactive()) { +\dontrun { # authorize using code flow set_arc_token(auth_code()) @@ -40,7 +39,6 @@ if (interactive()) { truncate_layer(flayer) } } -} \references{ \href{https://developers.arcgis.com/rest/services-reference/online/truncate-feature-layer-.htm}{ArcGIS Developers Rest API Doc} } diff --git a/man/update_params.Rd b/man/update_params.Rd index 86a5c4b..057a49f 100644 --- a/man/update_params.Rd +++ b/man/update_params.Rd @@ -18,7 +18,7 @@ An object of the same class as \code{x} \code{\link[=update_params]{update_params()}} takes named arguments and updates the query. } \examples{ -if (interactive()) { +\dontrun { furl <- paste0( "https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/", "USA_Major_Cities_/FeatureServer/0" diff --git a/man/utils.Rd b/man/utils.Rd index 06d7224..c43bd14 100644 --- a/man/utils.Rd +++ b/man/utils.Rd @@ -36,7 +36,7 @@ Returns an object of class \code{x}. } } \examples{ -if (interactive()) { +\dontrun { furl <- paste0( "https://services3.arcgis.com/ZvidGQkLaDJxRSJ2/arcgis/rest/services/", "PLACES_LocalData_for_BetterHealth/FeatureServer/0"