Skip to content

Commit

Permalink
v0.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
rmendels committed Jan 10, 2020
1 parent 3467038 commit 8225f71
Show file tree
Hide file tree
Showing 14 changed files with 102 additions and 83 deletions.
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Package: rerddapXtracto
Type: Package
Title: Extracts Environmental Data from 'ERDDAP' Web Services
Version: 0.4.5
Version: 0.4.6
Date: 2020-01-08
Authors@R: person("Roy", "Mendelssohn", email = "[email protected]", role = c("aut","cre"))
Description: Contains three functions that access
environmental data from any 'ERDDAP' data web service. The rxtracto() function extracts
Expand All @@ -25,7 +26,7 @@ Imports:
methods,
ncdf4,
parsedate,
plotdap,
plotdap (>= 0.0.5),
readr,
rerddap (>= 0.6.0),
sf,
Expand All @@ -38,7 +39,7 @@ Suggests:
maptools,
rgdal,
rmarkdown
RoxygenNote: 6.1.1
RoxygenNote: 7.0.2
Encoding: UTF-8
LazyData: TRUE
VignetteBuilder: knitr
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# rerddapXtracto 0.4.6

Changed vignette to work with latest version of 'plotdap' that now uses the colors from the 'cmocean' package

# rerddapXtracto 0.4.5

Added maptools and rgdal to Suggests to be consistent with of plotdap v0.0.4
Expand Down
8 changes: 4 additions & 4 deletions R/plotBBox.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#'
#' @export
#' @param resp data frame returned from 'rxtracto()'
#' @param plotColor the color to use in plot from 'rerddap'
#' @param plotColor the color to use in plot from 'cmocean'
#' @param time a function to map multi-time to one, or else identity
#' for animation
#' @param myFunc function of one argument to transform the data
Expand All @@ -30,7 +30,7 @@
#' tcoord = tcoord, zcoord = zcoord)
#' }
#' # low resolution selected to keep time to render down
#' p <- plotBBox(MBsst, plotColor = 'temperature', maxpixels = 300)
#' p <- plotBBox(MBsst, plotColor = 'thermal', maxpixels = 300)

plotBBox <- function(resp, plotColor = 'viridis', time = NA, myFunc = NA,
mapData = NULL, crs = NULL,
Expand Down Expand Up @@ -106,8 +106,8 @@ plotBBox <- function(resp, plotColor = 'viridis', time = NA, myFunc = NA,
ggplot2::guides(fill = ggplot2::guide_colourbar(title = name)))
}
if (animate) {
xlim <- c(min(myStruct$longitude), max(myStruct$longitude))
ylim <- c(min(myStruct$latitude), max(myStruct$latitude))
xlim <- c(min(myStruct$data$lon), max(myStruct$data$lon))
ylim <- c(min(myStruct$data$lat), max(myStruct$data$lat))
suppressMessages(myplot <- plotdap::add_ggplot(
myplot, ggplot2::coord_sf(
crs = myplot$crs, datum = myplot$datum,
Expand Down
4 changes: 2 additions & 2 deletions R/plotTrack.R
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @param ycoord passed to 'rxtracto()'
#' @param tcoord passed to 'rxtracto()'
#' @param resp data frame returned from 'rxtracto()'
#' @param plotColor the color to use in plot from 'rerddap'
#' @param plotColor the color to use in plot from 'cmocean'
#' @param myFunc function of one argument to transform the data
#' @param mapData map data from 'maps' or 'mapdata', must be of class 'map'
#' @param crs valid crs string
Expand All @@ -30,7 +30,7 @@
#' swchl <- rxtracto(swchlInfo, parameter = 'chlorophyll', xcoord = xpos,
#' ycoord = ypos, tcoord = tpos, zcoord = zpos, xlen = .2, ylen = .2)
#' }
#' p <- plotTrack(swchl, xpos, ypos, tpos, plotColor = 'chlorophyll')
#' p <- plotTrack(swchl, xpos, ypos, tpos, plotColor = 'algae')

plotTrack <- function(resp, xcoord, ycoord, tcoord, plotColor = 'viridis', myFunc = NA,
mapData = NULL, crs = NULL,
Expand Down
4 changes: 2 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## update Version 0.4.5
## update Version 0.4.6

Minor update, added maptools and rgdal to Suggests to be consistent with plotdap v0.0.4.
Minor update so that the vignette is consistent with 'plotdap' version 0.0.5


## Test environments
Expand Down
Binary file removed data/cmocean.RData
Binary file not shown.
38 changes: 0 additions & 38 deletions man/cmocean.Rd

This file was deleted.

19 changes: 14 additions & 5 deletions man/plotBBox.Rd
100644 → 100755

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

22 changes: 17 additions & 5 deletions man/plotTrack.Rd
100644 → 100755

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

1 change: 0 additions & 1 deletion man/rerddapXtracto.Rd
100644 → 100755

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

20 changes: 16 additions & 4 deletions man/rxtracto.Rd
100644 → 100755

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

18 changes: 14 additions & 4 deletions man/rxtracto_3D.Rd
100644 → 100755

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

18 changes: 14 additions & 4 deletions man/rxtractogon.Rd
100644 → 100755

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

22 changes: 11 additions & 11 deletions vignettes/UsingrerddapXtracto.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ We plot the track line with the locations colored according to the mean of the s
require("ggplot2")
require("plotdap")
myPlot <- plotTrack(swchl1, xpos, ypos, tpos, plotColor = 'chlorophyll')
myPlot <- plotTrack(swchl1, xpos, ypos, tpos, plotColor = 'algae')
myPlot
```

Expand All @@ -209,7 +209,7 @@ To make a cumulative animation of the track:

<span id="animateTrack"></span>
```{r animateTrack, echo = TRUE, eval = FALSE}
myPlot <- plotTrack(swchl1, xpos, ypos, tpos, plotColor = 'chlorophyll',
myPlot <- plotTrack(swchl1, xpos, ypos, tpos, plotColor = 'algae',
animate = TRUE, cumulative = TRUE)
```
Expand All @@ -232,7 +232,7 @@ xlim <- c(-160, -105)
topoInfo <- rerddap::info('etopo360')
topo <- rxtracto(topoInfo, parameter = 'altitude', xcoord = xpos, ycoord = ypos, xlen = .1, ylen = .1)
myFunc = function(x) -x
topoPlot <- plotTrack(topo, xpos, ypos, NA, plotColor = 'density', name = 'Depth', myFunc = myFunc)
topoPlot <- plotTrack(topo, xpos, ypos, NA, plotColor = 'dense', name = 'Depth', myFunc = myFunc)
topoPlot
```

Expand Down Expand Up @@ -325,7 +325,7 @@ We can map the data using `plotBBox()`:
require("ggplot2")
require("plotdap")
myFunc <- function(x) log(x)
chlalogPlot <- plotBBox(VIIRS, plotColor = 'chlorophyll', myFunc = myFunc)
chlalogPlot <- plotBBox(VIIRS, plotColor = 'algae', myFunc = myFunc)
chlalogPlot
```

Expand Down Expand Up @@ -408,7 +408,7 @@ myFunc <- function(x) log(x)
sanctchl1 <- sanctchl
sanctchl1$chla <- sanctchl1$chla[, , 2]
sanctchl1$time <- sanctchl1$time[2]
sanctchlPlot <- plotBBox(sanctchl1, plotColor = 'chlorophyll', myFunc = myFunc)
sanctchlPlot <- plotBBox(sanctchl1, plotColor = 'algae', myFunc = myFunc)
sanctchlPlot
```

Expand All @@ -421,7 +421,7 @@ require("gganimate")
require("ggplot2")
require("plotdap")
myFunc <- function(x) log(x)
sanctchlPlot <- plotBBox(sanctchl, plotColor = 'chlorophyll', myFunc = myFunc, time = identity, animate = TRUE)
sanctchlPlot <- plotBBox(sanctchl, plotColor = 'algae', myFunc = myFunc, time = identity, animate = TRUE)
```

![Sanctuary Animation](sanctuary.gif)
Expand All @@ -444,7 +444,7 @@ Mapping the data to show the canyon:
require("ggplot2")
require("mapdata")
myFunc = function(x) -x
bathyPlot <- suppressMessages((plotBBox(bathy, plotColor = 'density', myFunc = myFunc, name = 'Depth')))
bathyPlot <- suppressMessages((plotBBox(bathy, plotColor = 'dense', myFunc = myFunc, name = 'Depth')))
bathyPlot
```

Expand All @@ -470,7 +470,7 @@ str(soda70)
```{r soda70Plot, fig.width = 6, fig.height = 3, fig.align = 'center', warning = FALSE}
require("ggplot2")
require("plotdap")
sodaPlot <- plotBBox(soda70, plotColor = 'temperature', name = 'temp_at_70m', maxpixels = 30000)
sodaPlot <- plotBBox(soda70, plotColor = 'thermal', name = 'temp_at_70m', maxpixels = 30000)
sodaPlot
```
Expand All @@ -497,7 +497,7 @@ NAtlSSS <- rxtracto_3D(dataInfo, parameter = parameter, xcoord = sssLons, ycoord
```{r NAtlSSSplot, eval = FALSE, echo = TRUE}
require("ggplot2")
require("plotdap")
NAtlSSSPlot <- plotBBox(NAtlSSS, plotColor = 'salinity', name = "salinity", maxpixels = 30000)
NAtlSSSPlot <- plotBBox(NAtlSSS, plotColor = 'haline', name = "salinity", maxpixels = 30000)
NAtlSSSPlot
```

Expand Down Expand Up @@ -537,8 +537,8 @@ Plotting the results using `plotBBox()`:
```{r ifrPSALplot, fig.width = 6, fig.height = 3, fig.align='center', warning = FALSE}
require("ggplot2")
require("plotdap")
ifrPSALPlot <- plotBBox(ifrPSAL, plotColor = 'salinity', name = "salinity", maxpixels = 30000)
print(ifrPSALPlot)
ifrPSALPlot <- plotBBox(ifrPSAL, plotColor = 'haline', name = "salinity", maxpixels = 30000)
ifrPSALPlot
```


Expand Down

0 comments on commit 8225f71

Please sign in to comment.