Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/MartinSchobben/oceanexplorer

Easy exploration of the NOAA world ocean atlas
https://github.com/MartinSchobben/oceanexplorer

earth earth-observation earth-science noaa noaa-data ocean ocean-sciences oceanography open-data r r-package rstats shiny spatial spatial-analysis spatial-data

Last synced: about 2 months ago
JSON representation

Easy exploration of the NOAA world ocean atlas

Awesome Lists containing this project

README

        

---
output: github_document
bibliography: "vignettes/packages.bib"
---

# The oceanexplorer

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

```{r pkgs, echo=FALSE, message=FALSE, eval=FALSE}
# following code for loading and writing the bibtex references for the used pkgs
pkgs <- c(
# data transformation and visualization
"dplyr", "ggplot2", "purrr",
# package development
"devtools", "shinytest", "vdiffr", "roxygen2", "testthat",
# documentation
"knitr", "rmarkdown",
# spatial analysis
"stars", "sf", "ncmeta",
# shiny app
"thematic", "bslib", "shiny", "waiter", "shinyjs"
)
# Get the R reference
rref <- citation()
# Create ref key
rref$key <- "rversion"
hadley1 <- bibentry(
key = "Wickham2015",
bibtype = "Book",
title = "R packages: organize, test, document, and share your code",
author = person("Hadley","Wickham"),
year = "2015",
publisher = " O'Reilly Media, Inc.",
url = "https://r-pkgs.org/"
)
hadley2 <- bibentry(
key = "Wickham2020",
bibtype = "Book",
title = "Mastering Shiny: Build Interactive Apps, Reports & Dashboards.",
author = person("Hadley","Wickham"),
year = "2020",
publisher = " O'Reilly Media, Inc.",
url = "https://mastering-shiny.org/"
)
knitr::write_bib(pkgs, "vignettes/packages.bib", prefix = "")
pkgs <- bibtex::read.bib("vignettes/packages.bib")
bibtex::write.bib(
purrr::reduce(list(rref, hadley1, hadley2, pkgs), append),
file = "vignettes/packages.bib"
)
```

[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://choosealicense.com/licenses/mit/)
[![Codecov test coverage](https://codecov.io/gh/MartinSchobben/Oceanexplorer/branch/main/graph/badge.svg)](https://app.codecov.io/gh/MartinSchobben/Oceanexplorer?branch=main)
[![R-CMD-check](https://github.com/MartinSchobben/oceanexplorer/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/MartinSchobben/oceanexplorer/actions/workflows/R-CMD-check.yaml)

The goal of oceanexplorer is to enable easy access and exploration of the [World Ocean Atlas](https://www.nodc.noaa.gov/OC5/SELECT/woaselect/woaselect.html) of the US agency [NOAA](https://www.ncei.noaa.gov/).

![Demo of the ocean explorer app](man/figures/oceanexplorer-demo.gif){width=95%}

## Check the app

Check the app here: https://martinschobben.shinyapps.io/oceanexplorer/

## Funding

This project was funded by ERC Starting grant number 802835, OceaNice, awarded to Peter Bijl.

## Credits

The construction of the R [@rversion] package *oceanexplorer* and associated documentation was aided by the packages; *devtools* [@devtools], *roxygen2* [@roxygen2], *testthat* [@testthat], *shinytest* [@shinytest], *vdiffr* [@vdiffr], *knitr* [@knitr2014 ; @knitr2015], *rmarkdown* [@rmarkdown2018; @rmarkdown2020], and the superb guidance in the book: *R packages: organize, test, document, and share your code*, by @Wickham2015.

Data transformation, cleaning and visualization is performed with: *dplyr* [@dplyr], and *ggplot2* [@ggplot2].

In addition, this package relies on a set of packages for spatial data analysis: *sf* [@sf] and *stars* [@stars].

The app is build with *shiny* [@shiny] and the guidance in the book: *Mastering Shiny: Build Interactive Apps, Reports & Dashboards* [@Wickham2020] was a great help in learning how to develop such applications. Furthermore, the packages *shinyjs* [@shinyjs], *waiter* [@waiter], *bslib* [@bslib] and *thematic* [@thematic] ensure user-friendliness of the interface and visually pleasing graphics.

## Installation

You can install the latest version of oceanexplorer from CRAN

``` r
# Install oceanexplorer from CRAN:
install.packages("oceanexplorer")
```

## Example

The package allows extraction of global databases of several physical and chemical parameters of the ocean from the NOAA World Ocean Atlas.

```{r load}
library(oceanexplorer)
# obtain the NOAA world ocean atlas for oxygen content
oxy_global <- get_NOAA("oxygen", 1, "annual")
```

Slice a specific interval from the array with `filter_NOAA()`, like so:

```{r slice, eval=exists("oxy_global")}
# filter a depth of 200 meters to show OMZs
(oxy_omz <- filter_NOAA(oxy_global, depth = 200))
```

In addition, the sliced array can be plotted, like so:

```{r plot1, eval=exists("oxy_omz")}
# plot the NOAA world ocean atlas for oxygen content
plot_NOAA(oxy_omz, depth = NULL)
```

The same plot can be produced by taking the original data and supplying a value to the `depth` argument and specifying the range of oxygen content to `oxy_omz`.

```{r plot2, eval=exists("oxy_global")}
# plot the NOAA world ocean atlas for oxygen content
plot_NOAA(oxy_global, depth = 200, rng = range(oxy_omz[[1]]))
```

# Interactive exploration

Lastly, the package can launch a Shiny app for interactive exploration of the datasets.

```{r app, eval = FALSE}
# launch an interactive shiny session
NOAA_app()
```

The RStudio addin can be launched within the RStudio viewer pain by executing the following code, or by using the `Addins` drop down menu in the task-bar.

```{r addin, eval = FALSE}
# launch an interactive shiny session
NOAA_addin()
```

## Code of Conduct

Please note that the oceanexplorer project is released with a [Contributor Code of Conduct](https://martinschobben.github.io/oceanexplorer/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.

# References