diff --git a/DESCRIPTION b/DESCRIPTION index 6ca1a7c..370967c 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: plotdap Title: Easily Visualize Data from 'ERDDAP' Servers via the 'rerddap' Package -Version: 0.0.2 -Date: 2019-04-29 +Version: 0.0.3 +Date: 2019-07-25 Authors@R: c( person("Carson", "Sievert", role = "aut"), person("Roy", "Mendelssohn", role = c("aut", "ctb", "cre"), email = "roy.mendelssohn@noaa.gov")) @@ -10,7 +10,7 @@ License: MIT + file LICENSE URL: https://github.com/ropensci/plotdap BugReports: https://github.com/ropensci/plotdap/issues Depends: - R (>= 3.5.0), + R (>= 3.5.0), rerddap Imports: dplyr, @@ -19,21 +19,20 @@ Imports: lazyeval, lubridate, magrittr, - mapdata, - maps (>= 3.2.0), + maps, maptools, - plot3D, + raster, rgdal, rgeos, - raster, scales, sf, tidyr Suggests: - testthat, Cairo, knitr, - rmarkdown + mapdata, + rmarkdown, + testthat RoxygenNote: 6.1.1 LazyData: true Encoding: UTF-8 diff --git a/NEWS.md b/NEWS.md index 596ae29..eacc3f6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# plotdap 0.0.3 +* fixed small bug in an example that was causing 'pgkdown' to fail +* fixed Namespace and Import problems + # plotdap 0.0.2 First CRAN release diff --git a/R/add_ggplot.R b/R/add_ggplot.R index e6c59c0..3723248 100644 --- a/R/add_ggplot.R +++ b/R/add_ggplot.R @@ -10,14 +10,11 @@ #' @rdname add_ggplot #' @examples #' -#' library(ggplot2) -#' -#' add_ggplot( -#' plotdap( -#' crs = "+proj=laea +y_0=0 +lon_0=155 +lat_0=-90 +ellps=WGS84 +no_defs", -#' mapColor = "black" -#' ), -#' theme_bw() +#' p <- plotdap( +#' crs = "+proj=laea +y_0=0 +lon_0=155 +lat_0=-90 +ellps=WGS84 +no_defs") +#' p <- add_ggplot( +#' p, +#' ggplot2::theme_bw() #' ) #' #' diff --git a/R/add_tabledap.R b/R/add_tabledap.R index 2e5aa80..09ac87c 100644 --- a/R/add_tabledap.R +++ b/R/add_tabledap.R @@ -16,8 +16,7 @@ #' Currently only implemented for \code{method='ggplot2'} and requires the #' gganimate package. #' @param cumulative - if animation should be cumulative -default FALSE -#' @param ... arguments passed along to \code{geom_sf()} -#' (if \code{method='ggplot2'}, otherwise ignored). +#' @param ... arguments passed along to \code{geom_sf()} (if \code{method='ggplot2'}, otherwise ignored). #' @return A plotdap object #' @export #' @rdname add_tabledap @@ -32,10 +31,9 @@ #'\donttest{ #' sardines <- tabledap( #' 'FRDCPSTrawlLHHaulCatch', -#' fields = c('latitude', 'longitude', 'time', -#' 'scientific_name', 'subsample_count'), +#' fields = c('latitude', 'longitude', 'time', 'scientific_name', 'subsample_count'), #' 'time>=2010-01-01', 'time<=2012-01-01', -#' scientific_name="Sardinops sagax"' +#' scientific_name="Sardinops sagax" #' ) #'} #' diff --git a/R/plotdap.R b/R/plotdap.R index 6aff168..3c3d507 100755 --- a/R/plotdap.R +++ b/R/plotdap.R @@ -47,7 +47,7 @@ plotdap <- function(method = c("ggplot2", "base"), method <- match.arg(method, method) # packages used in both methods - require_packages(c("sf", "maps", "lazyeval")) + require_packages(c("sf", "maps", "lazyeval", "rgeos", "rgdal", "maptools")) # maps is bad at namespacing try_require("mapdata", "plotdap") diff --git a/cran-comments.md b/cran-comments.md index c9b87aa..156761e 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,56 +1,33 @@ +## This is a minor update + +- fix small error in docs that was causing pkgdown to fail +- fixed Import and Namespace problems reported on CRAN checks +- On Windows, previous version built with --no-vignettes please continue that +if Vignette build takes too long +- fixed single note on VignetteIndexEntry + ## Test environments -* local OS X install, R 3.5.3 -* Fedora Linux, R-devel, clang, gfortran (on RHub) +* local OS X install, R 3.6.1 +* Fedora Linux on RHub) * win-builder (devel and release) ## R CMD check results ### OS X -Duration: 8m 35.2s +Duration: 3m 53s 0 errors ✔ | 0 warnings ✔ | 0 notes ✔ - -### Winbuilder release -New submission - -Possibly mis-spelled words in DESCRIPTION: - rerddap (9:81) - - Spelling is correct +### Winbuilder release +OK ### Winbuilder devel -New submission - -Possibly mis-spelled words in DESCRIPTION: - rerddap (9:81) - -Spelling is correct +OK ### RHUb Windows Server 2008 R2 SP1, R-devel, 32/64 bit -New submission - -Possibly mis-spelled words in DESCRIPTION: - rerddap (9:81) - - Spelling is Correct - +OK ### RHub Fedora - -New submission - -Possibly mis-spelled words in DESCRIPTION: - rerddap (9:81) - -Spelling is correct - -### Comments - -In response to reviewer's comments on last submission, the `rerddap` that -would download the data that is contained in the package datasets have -been uncommented and put in \donttest{}. All other requested changes made. - -* This is a new release. +OK diff --git a/man/add_ggplot.Rd b/man/add_ggplot.Rd index 1c2f5a8..d611608 100644 --- a/man/add_ggplot.Rd +++ b/man/add_ggplot.Rd @@ -21,14 +21,11 @@ further ggplot2 settings } \examples{ -library(ggplot2) - -add_ggplot( - plotdap( - crs = "+proj=laea +y_0=0 +lon_0=155 +lat_0=-90 +ellps=WGS84 +no_defs", - mapColor = "black" - ), - theme_bw() +p <- plotdap( + crs = "+proj=laea +y_0=0 +lon_0=155 +lat_0=-90 +ellps=WGS84 +no_defs") +p <- add_ggplot( + p, + ggplot2::theme_bw() ) diff --git a/man/add_tabledap.Rd b/man/add_tabledap.Rd index 0f298b1..2e290d1 100644 --- a/man/add_tabledap.Rd +++ b/man/add_tabledap.Rd @@ -30,8 +30,7 @@ gganimate package.} \item{cumulative}{- if animation should be cumulative -default FALSE} -\item{...}{arguments passed along to \code{geom_sf()} -(if \code{method='ggplot2'}, otherwise ignored).} +\item{...}{arguments passed along to \code{geom_sf()} (if \code{method='ggplot2'}, otherwise ignored).} } \value{ A plotdap object @@ -40,3 +39,34 @@ A plotdap object \code{add_tabledap} adds the data from an 'rerddap::tabledap()' call to a 'plotdap' map } +\examples{ + +# base plotting tends to be faster, +# but is less extensible plotdap("base") + +# test datasets in data folder to meet execution timings +# code given to extract the data + +\donttest{ +sardines <- tabledap( + 'FRDCPSTrawlLHHaulCatch', + fields = c('latitude', 'longitude', 'time', 'scientific_name', 'subsample_count'), + 'time>=2010-01-01', 'time<=2012-01-01', + scientific_name="Sardinops sagax" + ) +} + +p <- plotdap() +p1 <- add_tabledap(p, sardines, ~subsample_count) +p2 <- add_tabledap(p, sardines, ~log2(subsample_count)) + +# using base R plotting +p <- plotdap("base") +p <- add_tabledap(p, sardines, ~subsample_count) + +# robinson projection +p <- plotdap(crs = "+proj=robin") +p <- add_tabledap(p, sardines, ~subsample_count) + + +} diff --git a/vignettes/sardines.png b/vignettes/sardines.png new file mode 100644 index 0000000..b15e589 Binary files /dev/null and b/vignettes/sardines.png differ diff --git a/vignettes/sardines2.png b/vignettes/sardines2.png new file mode 100644 index 0000000..f1603d3 Binary files /dev/null and b/vignettes/sardines2.png differ diff --git a/vignettes/using_plotdap.Rmd b/vignettes/using_plotdap.Rmd index ba53620..18f666c 100644 --- a/vignettes/using_plotdap.Rmd +++ b/vignettes/using_plotdap.Rmd @@ -4,7 +4,7 @@ author: "" date: "`r Sys.Date()`" output: rmarkdown::html_vignette vignette: > - %\VignetteIndexEntry{Vignette Title} + %\VignetteIndexEntry{Using plotdap} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- @@ -243,22 +243,7 @@ p2 ``` -```{r plot_sardines, echo = FALSE, out.width = '.49\\linewidth', fig.width = 3, fig.height = 4, message = FALSE, warning = FALSE} -p1 <- add_tabledap( - plotdap(crs = "+proj=robin", mapTitle = "subsample count"), - sardines, - ~subsample_count -) -p2 <- add_tabledap( - plotdap(crs = "+proj=robin", mapTitle = "Log subsample count"), - sardines, - ~log2(subsample_count) -) - -p1 -p2 -``` - +![](sardines.png) ## Modifying `tabledap()` layers @@ -285,25 +270,7 @@ p2 ``` -```{r plot_sardines2, echo = FALSE, fig.hold = TRUE, out.width = '.49\\linewidth', fig.width = 3, fig.height = 4, message = FALSE, warning = FALSE} -p1 <- add_tabledap( - plotdap(crs = "+proj=robin", mapTitle = "Sardines - change color"), - sardines, - ~subsample_count, - color = "density", -) -p2 <- add_tabledap( - plotdap(crs = "+proj=robin", mapTitle = "Sardines - change shape and size"), - sardines, - ~subsample_count, - shape = 4, - size = 1. - -) -p1 -p2 -``` - +![](sardines2.png) For further details about these arguments, please refer to the documentation on `help(add_tabledap)`.