Skip to content

Commit

Permalink
Example to \dontrun, avoid tests failing due to connection problems
Browse files Browse the repository at this point in the history
  • Loading branch information
pitkant committed May 12, 2021
1 parent bd2353c commit 638476a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 25 deletions.
31 changes: 17 additions & 14 deletions R/get_eurostat_geospatial.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,20 @@
#' @author Markus Kainu <markuskainu@gmail.com>
#' @return a sf, data_frame or SpatialPolygonDataFrame.
#' @examples
#' sf <- get_eurostat_geospatial(output_class = "sf",
#' resolution = "60",
#' nuts_level = "all")
#' df <- get_eurostat_geospatial(output_class = "df",
#' resolution = "20",
#' nuts_level = "0")
#' \dontrun{
#' spdf <- get_eurostat_geospatial(output_class = "spdf",
#' resolution = "10",
#' nuts_level = "3")
#' }
#' \dontrun{
#' sf <- get_eurostat_geospatial(output_class = "sf",
#' resolution = "60",
#' nuts_level = "all")
#' df <- get_eurostat_geospatial(output_class = "df",
#' resolution = "20",
#' nuts_level = "0")
#' }
#'
#' \dontrun{
#' spdf <- get_eurostat_geospatial(output_class = "spdf",
#' resolution = "10",
#' nuts_level = "3")
#' }
#'
#' \dontrun{
#' # -------------------------------------------------------------------
Expand Down Expand Up @@ -97,7 +100,7 @@ get_eurostat_geospatial <- function(output_class = "sf",
nuts_level = "all", year = "2016",
cache = TRUE, update_cache = FALSE,
cache_dir = NULL, crs = "4326",
make_valid = FALSE){
make_valid = FALSE){
# Check if you have access to ec.europe.eu.
if (!check_access_to_data()){
message("You have no access to ec.europe.eu.
Expand All @@ -107,8 +110,8 @@ get_eurostat_geospatial <- function(output_class = "sf",
eurostat_geodata_60_2016 <- NULL
LEVL_CODE <- NULL
utils::data("eurostat_geodata_60_2016",
envir = environment(),
package = "eurostat")
envir = environment(),
package = "eurostat")

# Check output_class is of correct format
stopifnot(length(output_class) == 1L)
Expand Down
25 changes: 14 additions & 11 deletions man/get_eurostat_geospatial.Rd

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

0 comments on commit 638476a

Please sign in to comment.