Skip to content

Commit

Permalink
Inital CRAN Release
Browse files Browse the repository at this point in the history
  • Loading branch information
rmendels committed May 19, 2019
1 parent 666cde5 commit 05bf1bc
Show file tree
Hide file tree
Showing 85 changed files with 64 additions and 11,332 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Date: 2019-04-29
Authors@R: c(
person("Carson", "Sievert", role = "aut"),
person("Roy", "Mendelssohn", role = c("aut", "ctb", "cre"), email = "[email protected]"))
Description: Easily visualize 'tabledap' and 'griddap' objects obtained via the rerddap package.
Description: Easily visualize and animate 'tabledap' and 'griddap' objects obtained via the 'rerddap' package in a simple one-line command, using either base graphics or 'ggplot2' graphics. 'plotdap' handles extracting and reshaping the data, map projections and continental outlines. Optionally the data can be animated through time using the 'gganmiate' package.
License: MIT + file LICENSE
URL: https://github.com/ropensci/plotdap
BugReports: https://github.com/ropensci/plotdap/issues
Expand Down
41 changes: 22 additions & 19 deletions R/add_griddap.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,42 @@
#' # base plotting tends to be faster,
#' # but is less extensible plotdap("base")
#'
#' # code to obtain datasets using `rerddap` given as comment
#' # actual datasets in data folder to meet execution timings
#'
#' # murSST <- griddap(
#' # 'jplMURSST41', latitude = c(35, 40), longitude = c(-125, -1205),
#' # time = c('last', 'last'), fields = 'analysed_sst'
#' # )
#'\donttest{
#' murSST <- griddap(
#' 'jplMURSST41', latitude = c(35, 40), longitude = c(-125, -1205),
#' time = c('last', 'last'), fields = 'analysed_sst'
#' )
#'
#' QMwind <- griddap(
#' 'erdQMwindmday', time = c('2016-11-16', '2017-01-16'),
#' latitude = c(30, 50), longitude = c(210, 240),
#' fields = 'x_wind'
#' )
#'
#' p <- plotdap(crs = "+proj=robin")
#' add_griddap(p, murSST, ~analysed_sst)
#'
#' p <- plotdap(mapTitle = "Average wind over time")
#' add_griddap(p, QMwind, ~x_wind)
#'
#'}
#'
#
#' p <- plotdap("base", crs = "+proj=robin")
#' p <- add_griddap(p, murSST, ~analysed_sst)
#'
#' # layer tables on top of grids
#' require(magrittr)
#' p <- plotdap("base") %>%
#' add_griddap(murSST, ~analysed_sst) %>%
#' add_tabledap(sardines, ~subsample_count)
#'
#' # multiple time periods
#' # wind <- griddap(
#' # 'erdQMwindmday', time = c('2016-11-16', '2017-01-16'),
#' # latitude = c(30, 50), longitude = c(210, 240),
#' # fields = 'x_wind'
#' # )
#' p <- plotdap("base", mapTitle = "Average wind over time")
#' p <- add_griddap(p, QMwind, ~x_wind)
#'
#'\donttest{
#' # ggplot2 add_griddap functions take too long for CRAN
#' # but here are the same examples from above
#' p <- plotdap(crs = "+proj=robin")
#' add_griddap(p, murSST, ~analysed_sst)
#'
#' p <- plotdap(mapTitle = "Average wind over time")
#' add_griddap(p, QMwind, ~x_wind)
#'}

add_griddap <- function(plot, grid, var, fill = "viridis",
maxpixels = 10000, time = mean, animate = FALSE,
Expand Down
26 changes: 14 additions & 12 deletions R/add_tabledap.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,22 @@
#' # base plotting tends to be faster,
#' # but is less extensible plotdap("base")
#'
#' # code to obtain datasets using `rerddap` given as comment
#' # actual datasets in data folder to meet execution timings
#' # 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"'
#' )
#'}
#'
#' # tabledap examples
#' # 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()
#' p <- add_tabledap(p, sardines, ~subsample_count)
#' p1 <- add_tabledap(p, sardines, ~log2(subsample_count))
#' p1 <- add_tabledap(p, sardines, ~subsample_count)
#' p2 <- add_tabledap(p, sardines, ~log2(subsample_count))
#'
#' # using base R plotting
#' p <- plotdap("base")
Expand Down
Loading

0 comments on commit 05bf1bc

Please sign in to comment.