Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new vignette, colors #51

Merged
merged 3 commits into from
Jan 17, 2017
Merged

Added new vignette, colors #51

merged 3 commits into from
Jan 17, 2017

Conversation

rmendels
Copy link
Collaborator

@rmendels rmendels commented Jan 2, 2017

Added new vignette to the vignettes, and the file colors.Rda in the
data folder, which is used for the color palettes

Added new vignette to the vignettes, and the file colors.Rda in the
data folder, which is used for the color palettes
@codecov-io
Copy link

codecov-io commented Jan 2, 2017

Current coverage is 0.00% (diff: 100%)

Merging #51 into master will not change coverage

@@           master   #51   diff @@
===================================
  Files          19    19          
  Lines         689   690     +1   
  Methods         0     0          
  Messages        0     0          
  Branches        0     0          
===================================
  Hits            0     0          
- Misses        689   690     +1   
  Partials        0     0          

Powered by Codecov. Last update 1d14420...0424af8

Copy link
Contributor

@sckott sckott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work!

Can we add a small section on when to use griddap vs. tabledap?


```{r}
library("rerddap")
load("colors.rda")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change this to data(colors)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as it gets loaded on package load

Besides `rerddap` the following libraries are used in this vignette:

```{r, warning = FALSE}
library("akima")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if possible limit the package dependencies here since these all have to be put in Suggests in the rerddap DESCRIPTION file, and then our Travis builds need all those, etc.

Fine to leave any that you absolutely need though


MUR (Multi-scale Ultra-high Resolution) is an analyzed SST product at 0.01-degree resolution going back to 2002, providing one of the longest satellite based time series at such high resolution. We extract the latest data available for a region off the west coast.

```{r MUR, fig.width = 6, fig.height = 3, fig.align = 'center', warning = FALSE}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would include cache = TRUE here so this chunk doesn't take too long

date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{rerddapVignette}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the VignetteIndexEntry to something a little more informative, the one for the other vignette is rerddap introduction


```{r}
require("ncdf4")
sstFile <- nc_open('MWsstd1day.nc')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file is missing, so this part fails on vignette build


`rerddap` is a general purpose <span style="color:blue">R</span> client for working with <span style="color:blue">ERDDAP</span> servers. <span style="color:blue">ERDDAP</span> is a web service developed by Bob Simons of NOAA. At the time of this writing, there are over fifty <span style="color:blue">ERDDAP</span> servers (though not all are public facing) providing access to literally petabytes of data and model output relevant to oceanography, meteorology, fisheries and marine mammals, among other areas. <span style="color:blue">ERDDAP</span> is a simple to use, RESTful web service, that allows data to be subsetted and returned in a variety of formats.

In this vignette we go over some of the nuts and bolts of using the `rerddap` package, and show the power of the combination of the `rerddap` package with <span style="color:blue">ERDDAP</span> servers. Some of the examples are taken from the `xtractomatic` package (available from CRAN), and some from the `rerddapXtracto` package available on Github, but reworked to use `rerddap` directly. Other examples are new to this vignette, and include both gridded and non-gridded datasets from several <span style="color:blue">ERDDAPs</span>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include links to xtractomatic and rerddapXtracto for easy finding

library("parsedate")
library("plot3D")
library("xts")
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a bunch of messages/et.c when these pkgs load, e.g.,

library("akima")
library("dplyr")
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library("ggfortify")

maybe duplicate this block of code, and with one of them just set to eval=FALSE so it doesn't run, but is shown to reader, and with the other one, add warn.conflicts = FALSE and quietly = TRUE (or maybe just quietly = TRUE)


## Introduction

`rerddap` is a general purpose <span style="color:blue">R</span> client for working with <span style="color:blue">ERDDAP</span> servers. <span style="color:blue">ERDDAP</span> is a web service developed by Bob Simons of NOAA. At the time of this writing, there are over fifty <span style="color:blue">ERDDAP</span> servers (though not all are public facing) providing access to literally petabytes of data and model output relevant to oceanography, meteorology, fisheries and marine mammals, among other areas. <span style="color:blue">ERDDAP</span> is a simple to use, RESTful web service, that allows data to be subsetted and returned in a variety of formats.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the blue styling for ERDDAAP text, but it does look like a link since the actual links are the same color. I wonder if you could use a different color, or bold or italicize?


## Cacheing, "last", "now", idempotency, and a gotcha

`rerddap` by default caches the requests you make, so that if you happen to make the same request again, the data is restored from the cache, rather than having to go out and retrieve it remotely. For most applications, this a boon (such a when "knitting" and "reknitting" this document), as it can speed things up when doing a lot of request in a script, and works because in most cases an <span style="color:blue">ERDDAP</span> request is "idempotent". This means that the the request will always return the same thing no matter what requests came before - it doesn't depend on state. However this is not true if the script uses either "last" in `griddap()` or "now" in `tabledap()` as these will return different values as time elapses and data are added to the datasets. While it is desirable to have <span style="color:blue">ERDDAP</span> purely idempotent, the "last" and "now" constructs are very helpful for people using <span style="color:blue">ERDDAP</span> in dashboards, webpages, regular input to models and the like, and the benefits far outweigh the problems. However, if you are using either "last" or "now" in an `rerddap` based script, you want to be very careful to clear the `rerddap` cache, otherwise the request will be viewed as the same, and the data from the last request, rather than the latest data, will be returned. Note that several examples in this vignette use "last", and therefore the graphics may look different depending on when you "knitted" the vignette.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add something to the documentation about this, will open an issue

@rmendels
Copy link
Collaborator Author

rmendels commented Jan 4, 2017 via email

@sckott
Copy link
Contributor

sckott commented Jan 4, 2017

@rmendels you can just add changes to your version of rerddap on github and they will be added here automatically. If you had made a different branch off master to e.g., foobar, then you'd have to make sure those changes are added to foobar - which would then be added here

All requested edits done.
Number of external packages used  sharply reduced.
Several new examples included.
Example netcdf file include in /inst/extdata, and successfully used in
vignette.
Info file for colors.rda included (colors.R)
A lot of minor edits.
Bugs in SODA and IMI titles fixed.  References to the original sources
of the data for many of the datasets improved.
@sckott sckott merged commit 29ff1f7 into ropensci:master Jan 17, 2017
@sckott sckott added this to the v0.4 milestone Jan 17, 2017
@sckott sckott modified the milestones: v0.4, v0.3.6 Apr 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants