knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
# 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" )
The goal of oceanexplorer is to enable easy access and exploration of the World Ocean Atlas of the US agency NOAA.
{width=95%}
Check the app here: https://martinschobben.shinyapps.io/oceanexplorer/
This project was funded by ERC Starting grant number 802835, OceaNice, awarded to Peter Bijl.
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.
You can install the latest version of oceanexplorer from CRAN
# Install oceanexplorer from CRAN: install.packages("oceanexplorer")
The package allows extraction of global databases of several physical and chemical parameters of the ocean from the NOAA World Ocean Atlas.
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:
# 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:
# 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
.
# plot the NOAA world ocean atlas for oxygen content plot_NOAA(oxy_global, depth = 200, rng = range(oxy_omz[[1]]))
Lastly, the package can launch a Shiny app for interactive exploration of the datasets.
# 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.
# launch an interactive shiny session NOAA_addin()
Please note that the oceanexplorer project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.