diff --git a/R/geom-polypath.R b/R/geom-polypath.R index 99a9a30..2abf211 100644 --- a/R/geom-polypath.R +++ b/R/geom-polypath.R @@ -26,10 +26,12 @@ #' @export #' #' @examples +#' \donttest{ #' library(ggplot2) #' load_longlake_data(which = "longlake_waterdf") #' ggplot(df_spatial(longlake_waterdf), aes(x, y, group = piece_id)) + #' geom_polypath() +#' } #' geom_polypath <- function (mapping = NULL, data = NULL, stat = "identity", position = "identity", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, rule = "winding", diff --git a/R/layer-spatial-bbox.R b/R/layer-spatial-bbox.R index ebbe3ab..26539c3 100644 --- a/R/layer-spatial-bbox.R +++ b/R/layer-spatial-bbox.R @@ -13,6 +13,7 @@ #' @export #' #' @examples +#' \donttest{ #' library(ggplot2) #' load_longlake_data(which = c("longlake_waterdf", "longlake_depthdf")) #' ggplot() + @@ -24,6 +25,7 @@ #' ggplot() + #' shadow_spatial(longlake_waterdf) + #' layer_spatial(longlake_depthdf) +#' } #' layer_spatial.bbox <- function(data, mapping = aes(), ..., detail = 30) { layer_spatial(sf_bbox_to_sf(data, detail = detail), mapping = mapping, ...) diff --git a/R/layer-spatial-raster.R b/R/layer-spatial-raster.R index 9606d98..084d2c4 100644 --- a/R/layer-spatial-raster.R +++ b/R/layer-spatial-raster.R @@ -17,10 +17,12 @@ #' @export #' #' @examples +#' \donttest{ #' library(ggplot2) #' load_longlake_data(which = c("longlake_osm", "longlake_depth_raster")) #' ggplot() + layer_spatial(longlake_osm) #' ggplot() + layer_spatial(longlake_depth_raster) + scale_fill_continuous(na.value = NA) +#' } #' layer_spatial.Raster <- function(data, mapping = NULL, interpolate = NULL, is_annotation = FALSE, lazy = FALSE, dpi = 150, ...) { diff --git a/R/layer-spatial.R b/R/layer-spatial.R index 1cbd100..00dfbfc 100644 --- a/R/layer-spatial.R +++ b/R/layer-spatial.R @@ -16,6 +16,7 @@ #' @importFrom ggplot2 aes #' #' @examples +#' \donttest{ #' library(ggplot2) #' load_longlake_data( #' which = c( @@ -43,6 +44,7 @@ #' #' # spatial-aware automagic north arrow #' annotation_north_arrow(location = "br", which_north = "true") +#' } #' layer_spatial <- function(data, mapping, ...) { UseMethod("layer_spatial") diff --git a/man/geom_polypath.Rd b/man/geom_polypath.Rd index 4eef427..f07fc56 100644 --- a/man/geom_polypath.Rd +++ b/man/geom_polypath.Rd @@ -46,9 +46,11 @@ implementation fixes a bug in the \code{ggpolypath} package, which provides similar functionality. } \examples{ +\donttest{ library(ggplot2) load_longlake_data(which = "longlake_waterdf") ggplot(df_spatial(longlake_waterdf), aes(x, y, group = piece_id)) + geom_polypath() +} } diff --git a/man/layer_spatial.Raster.Rd b/man/layer_spatial.Raster.Rd index 6517709..d1edc99 100644 --- a/man/layer_spatial.Raster.Rd +++ b/man/layer_spatial.Raster.Rd @@ -63,10 +63,12 @@ This is intended for use with RGB(A) rasters (e.g., georeferenced imagery or pho bands as if they were columns, use \link{df_spatial} and \link{geom_raster}. } \examples{ +\donttest{ library(ggplot2) load_longlake_data(which = c("longlake_osm", "longlake_depth_raster")) ggplot() + layer_spatial(longlake_osm) ggplot() + layer_spatial(longlake_depth_raster) + scale_fill_continuous(na.value = NA) +} } \keyword{datasets} diff --git a/man/layer_spatial.Rd b/man/layer_spatial.Rd index 5c7e3e5..3344cbe 100644 --- a/man/layer_spatial.Rd +++ b/man/layer_spatial.Rd @@ -53,6 +53,7 @@ See also \code{\link[=layer_spatial.Raster]{layer_spatial.Raster()}}, \code{\lin for other types of spatial objects. } \examples{ +\donttest{ library(ggplot2) load_longlake_data( which = c( @@ -80,5 +81,6 @@ ggplot() + # spatial-aware automagic north arrow annotation_north_arrow(location = "br", which_north = "true") +} } diff --git a/man/layer_spatial.bbox.Rd b/man/layer_spatial.bbox.Rd index b27657f..299bb8e 100644 --- a/man/layer_spatial.bbox.Rd +++ b/man/layer_spatial.bbox.Rd @@ -28,6 +28,7 @@ To include a bounding box without drawing it, use \code{\link[=shadow_spatial]{s original object. } \examples{ +\donttest{ library(ggplot2) load_longlake_data(which = c("longlake_waterdf", "longlake_depthdf")) ggplot() + @@ -39,5 +40,6 @@ ggplot() + ggplot() + shadow_spatial(longlake_waterdf) + layer_spatial(longlake_depthdf) +} }