diff --git a/R/colors.R b/R/colors.R index f84fae092..f508546ea 100644 --- a/R/colors.R +++ b/R/colors.R @@ -260,7 +260,7 @@ colorFactor <- function(palette, domain, levels = NULL, ordered = FALSE, #' pal <- colorBin("Greens", domain = 0:100) #' pal(runif(10, 60, 100)) #' -#' if (interactive()) { +#' \donttest{ #' # Exponential distribution, mapped continuously #' previewColors(colorNumeric("Blues", domain = NULL), sort(rexp(16))) #' # Exponential distribution, mapped by interval diff --git a/R/layers.R b/R/layers.R index 84701b7cd..f8da1741c 100644 --- a/R/layers.R +++ b/R/layers.R @@ -221,7 +221,7 @@ epsg3857 <- "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y #' @template data-getMapData #' #' @examples -#' library(raster) +#' \donttest{library(raster) #' #' r <- raster(xmn = -2.8, xmx = -2.79, ymn = 54.04, ymx = 54.05, nrows = 30, ncols = 30) #' values(r) <- matrix(1:900, nrow(r), ncol(r), byrow = TRUE) @@ -230,7 +230,7 @@ epsg3857 <- "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y #' if (requireNamespace("rgdal")) { #' leaflet() %>% addTiles() %>% #' addRasterImage(r, colors = "Spectral", opacity = 0.8) -#' } +#' }} #' @export addRasterImage <- function( map, diff --git a/R/methods.R b/R/methods.R index 0e518e741..d394ae1aa 100644 --- a/R/methods.R +++ b/R/methods.R @@ -12,10 +12,11 @@ #' @describeIn map-methods Set the view of the map (center and zoom level) #' @export #' @examples -#' m <- leaflet() %>% addTiles() %>% setView(-71.0382679, 42.3489054, zoom = 18) +#' \donttest{m <- leaflet() %>% addTiles() %>% setView(-71.0382679, 42.3489054, zoom = 18) #' m # the RStudio 'headquarter' #' m %>% fitBounds(-72, 40, -70, 43) #' m %>% clearBounds() # world view +#' } setView <- function(map, lng, lat, zoom, options = list()) { view <- evalFormula(list(c(lat, lng), zoom, options)) diff --git a/R/plugin-simplegraticule.R b/R/plugin-simplegraticule.R index 6d520441c..2f3c75025 100644 --- a/R/plugin-simplegraticule.R +++ b/R/plugin-simplegraticule.R @@ -23,9 +23,9 @@ leafletSimpleGraticuleDependencies <- function() { #' @param layerId the layer id #' @param group the name of the group this layer belongs to. #' @examples -#' leaflet() %>% +#' \donttest{leaflet() %>% #' addTiles() %>% -#' addSimpleGraticule() +#' addSimpleGraticule()} #' #' @export addSimpleGraticule <- function( diff --git a/cran-comments.md b/cran-comments.md index 82fd8241e..8ee4c6460 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,5 +1,10 @@ # Comments +## 2018-4-20 +Resubmitting to avoid example execution time NOTE. Test environment outputs updated below. + +- Barret + ## 2018-4-19 This submission is done by Barret Schloerke on behalf of Joe Cheng . Please submit any changes to be made to . @@ -8,37 +13,32 @@ This submission is done by Barret Schloerke on behalf of Jo ## Test environments * local OS X install, R 3.4.4, --run-dontcheck - * 0 errors | 0 warnings | 0 note + * 0 errors | 0 warnings | 0 notes * ubuntu 12.04 (on travis-ci), R version 3.4.4 (2017-01-27) - * 0 errors | 0 warnings | 0 note + * 0 errors | 0 warnings | 0 notes +* devtools::build_win() x86_64-w64-mingw32, R version 3.4.4 (2018-03-15) + * 0 errors | 0 warnings | 0 notes I believe the warning and note below are transient within r-hub. * WARNING: Conversion of "README.md" failed: * the svg at https://travis-ci.org/rstudio/leaflet.svg?branch=master exists - * NOTE: checking examples: - * The examples are taking a longer time only on windows and hardly any time is user or system. * NOTE: checking package dependencies * On linux... Packages suggested but not available for checking: ‘sf’ ‘rgdal’ ‘rgeos’ * r-hub * Platform: Windows Server 2008 R2 SP1, R-release, 32/64 bit - https://builder.r-hub.io/status/leaflet_2.0.0.tar.gz-530b3d51e28d4a0dae75211474df73e6 + https://builder.r-hub.io/status/leaflet_2.0.0.tar.gz-3915b63fe8c34d99b3ad7aa4b6e94640 ❯ checking top-level files ... WARNING Conversion of 'README.md' failed: pandoc.exe: Could not fetch https://travis-ci.org/rstudio/leaflet.svg?branch=master no store CallStack (from HasCallStack): error, called at .\System\X509\Win32.hs:56:31 in x509-system-1.6.4-E9zvdZ6nI282vjtOPFYSd1:System.X509.Win32 - ❯ checking examples ... NOTE - Examples with CPU or elapsed time > 5s - leaflet 1.26 1.7 5.33 - user system elapsed - ** found \donttest examples: check also with --run-donttest - 0 errors ✔ | 1 warning ✖ | 1 note ✖ + 0 errors ✔ | 1 warning ✖ | 0 notes ✔ * Platform: Windows Server 2008 R2 SP1, R-devel, 32/64 bit - https://builder.r-hub.io/status/leaflet_2.0.0.tar.gz-399d221fdf1648d5a6eb615f68abc1fa + https://builder.r-hub.io/status/leaflet_2.0.0.tar.gz-fb1316cbeb5f48eba08e959769a990d4 ❯ checking top-level files ... WARNING Conversion of 'README.md' failed: pandoc.exe: Could not fetch https://travis-ci.org/rstudio/leaflet.svg?branch=master @@ -46,23 +46,19 @@ I believe the warning and note below are transient within r-hub. CallStack (from HasCallStack): error, called at .\System\X509\Win32.hs:56:31 in x509-system-1.6.4-E9zvdZ6nI282vjtOPFYSd1:System.X509.Win32 - ❯ checking examples ... NOTE - Examples with CPU or elapsed time > 5s - user system elapsed - leaflet 1.61 1.35 5.75 - ** found \donttest examples: check also with --run-donttest - - 0 errors ✔ | 1 warning ✖ | 1 note ✖ + 0 errors ✔ | 1 warning ✖ | 0 notes ✔ * Platform: Ubuntu Linux 16.04 LTS, R-release, GCC - https://builder.r-hub.io/status/leaflet_2.0.0.tar.gz-bba7e3975ec949f8ba24843bf68be6eb + * checked with `_R_CHECK_FORCE_SUGGESTS_=0` + https://builder.r-hub.io/status/leaflet_2.0.0.tar.gz-cec4735e750d4f1ea05dca55c153a847 ❯ checking package dependencies ... NOTE Packages suggested but not available for checking: ‘sf’ ‘rgdal’ ‘rgeos’ 0 errors ✔ | 0 warnings ✔ | 1 note ✖ * Platform: Fedora Linux, R-devel, clang, gfortran - https://builder.r-hub.io/status/leaflet_2.0.0.tar.gz-9178afdcb7594c9da0550ca2846bda0e + * checked with `_R_CHECK_FORCE_SUGGESTS_=0` + https://builder.r-hub.io/status/leaflet_2.0.0.tar.gz-09d8a5861fb74ed3baa34d727f1df82b ❯ checking package dependencies ... NOTE Packages suggested but not available for checking: ‘sf’ ‘rgdal’ ‘rgeos’ diff --git a/inst/examples/leaflet.R b/inst/examples/leaflet.R index a87e8d2a4..d44e2a780 100644 --- a/inst/examples/leaflet.R +++ b/inst/examples/leaflet.R @@ -3,6 +3,7 @@ library(leaflet) m <- leaflet() %>% addTiles() m # a map with the default OSM tile layer +\donttest{ # set bounds m %>% fitBounds(0, 40, 10, 50) @@ -156,3 +157,5 @@ m %>% addCircleMarkers(~lng, ~lat, radius = ~size, greens <- colorNumeric("Greens", domain = NULL) m %>% addCircleMarkers(~lng, ~lat, radius = ~size, color = ~greens(value), fillOpacity = 0.5) + +} diff --git a/inst/examples/legend.R b/inst/examples/legend.R index b2538ed01..1e27bdf03 100644 --- a/inst/examples/legend.R +++ b/inst/examples/legend.R @@ -8,6 +8,8 @@ leaflet() %>% addTiles() %>% addLegend( title = "An Obvious Legend" ) +\donttest{ + # an automatic legend derived from the color palette df <- local({ n <- 300; x <- rnorm(n); y <- rnorm(n) @@ -38,3 +40,4 @@ leaflet(df) %>% transform = function(x) 100 * x ), group = "circles", position = "bottomleft" ) %>% addLayersControl(overlayGroups = c("circles")) +} diff --git a/man/addLegend.Rd b/man/addLegend.Rd index e18637230..1d0e1419a 100644 --- a/man/addLegend.Rd +++ b/man/addLegend.Rd @@ -115,6 +115,8 @@ leaflet() \%>\% addTiles() \%>\% addLegend( title = "An Obvious Legend" ) +\donttest{ + # an automatic legend derived from the color palette df <- local({ n <- 300; x <- rnorm(n); y <- rnorm(n) @@ -146,3 +148,4 @@ leaflet(df) \%>\% ), group = "circles", position = "bottomleft" ) \%>\% addLayersControl(overlayGroups = c("circles")) } +} diff --git a/man/addRasterImage.Rd b/man/addRasterImage.Rd index ba12e6046..1d950bb8d 100644 --- a/man/addRasterImage.Rd +++ b/man/addRasterImage.Rd @@ -74,7 +74,7 @@ maps, you can perform the projection ahead of time using \code{project = FALSE}. } \examples{ -library(raster) +\donttest{library(raster) r <- raster(xmn = -2.8, xmx = -2.79, ymn = 54.04, ymx = 54.05, nrows = 30, ncols = 30) values(r) <- matrix(1:900, nrow(r), ncol(r), byrow = TRUE) @@ -83,5 +83,5 @@ crs(r) <- CRS("+init=epsg:4326") if (requireNamespace("rgdal")) { leaflet() \%>\% addTiles() \%>\% addRasterImage(r, colors = "Spectral", opacity = 0.8) -} +}} } diff --git a/man/addSimpleGraticule.Rd b/man/addSimpleGraticule.Rd index 6f1a43c07..af416e1e0 100644 --- a/man/addSimpleGraticule.Rd +++ b/man/addSimpleGraticule.Rd @@ -31,8 +31,8 @@ Add a simple Graticule on the map see \url{https://github.com/ablakey/Leaflet.SimpleGraticule} } \examples{ -leaflet() \%>\% +\donttest{leaflet() \%>\% addTiles() \%>\% - addSimpleGraticule() + addSimpleGraticule()} } diff --git a/man/colorNumeric.Rd b/man/colorNumeric.Rd index 032751b71..49e8b77e0 100644 --- a/man/colorNumeric.Rd +++ b/man/colorNumeric.Rd @@ -109,7 +109,7 @@ The \code{palette} argument can be any of the following: pal <- colorBin("Greens", domain = 0:100) pal(runif(10, 60, 100)) -if (interactive()) { +\donttest{ # Exponential distribution, mapped continuously previewColors(colorNumeric("Blues", domain = NULL), sort(rexp(16))) # Exponential distribution, mapped by interval diff --git a/man/leaflet.Rd b/man/leaflet.Rd index 93a031cf7..a46b1c13e 100644 --- a/man/leaflet.Rd +++ b/man/leaflet.Rd @@ -108,6 +108,7 @@ library(leaflet) m <- leaflet() \%>\% addTiles() m # a map with the default OSM tile layer +\donttest{ # set bounds m \%>\% fitBounds(0, 40, 10, 50) @@ -261,6 +262,8 @@ m \%>\% addCircleMarkers(~lng, ~lat, radius = ~size, greens <- colorNumeric("Greens", domain = NULL) m \%>\% addCircleMarkers(~lng, ~lat, radius = ~size, color = ~greens(value), fillOpacity = 0.5) + +} } \seealso{ \code{\link{leafletCRS}} for creating a custom CRS. diff --git a/man/map-methods.Rd b/man/map-methods.Rd index f28522f66..3fbfca77e 100644 --- a/man/map-methods.Rd +++ b/man/map-methods.Rd @@ -59,11 +59,12 @@ if available (otherwise the full world view is used) }} \examples{ -m <- leaflet() \%>\% addTiles() \%>\% setView(-71.0382679, 42.3489054, zoom = 18) +\donttest{m <- leaflet() \%>\% addTiles() \%>\% setView(-71.0382679, 42.3489054, zoom = 18) m # the RStudio 'headquarter' m \%>\% fitBounds(-72, 40, -70, 43) m \%>\% clearBounds() # world view } +} \references{ \url{http://leafletjs.com/reference-1.3.1.html#map-methods-for-modifying-map-state} }