ternaustralia/ausplotsR

Examples return errors when data resource unavailable

Closed this issue · 1 comments

Recent updates implemented graceful fail when the database resource is unavailable (timeout, not internet etc). A residual issues is that when the resource is unavailable, the examples and vignette still return errors because they assume there is data and subsequently process data.

Package appears to have been removed from CRAN due to errors when server was moved.

Need to record whether data were returned and if not, bypass pass subsequent code with message.

Addressed in gracefully_fail_examples branch in two ways:

  1. All examples in MAN wrapped in \dontrun{} as all are based on extracting sample data first (with exception of dune data for opt function). This ensures users can get example code but build/check won't fail when internet of database not available.

  2. For the vignette, after ausplots data are extracted to use in the examples, hidden code chunk checks whether the object is a list (will be NULL if resource unavailable) and if not, terminates the knitting with a message.