mapApp: Interactive App For Viewing Argo Float Positions

View source: R/mapApp.R

mapAppR Documentation

Interactive App For Viewing Argo Float Positions

Description

mapApp() sets up an interactive "shiny app" session for exploring the spatial-temporal distribution of Argo profiles. The graphical user interface (GUI) is meant to be reasonably self-explanatory, and a button labelled Help yields a pop-up window with more information that might not be evident at first glance. A number of keystrokes exist to assist the user including:
u: undo previous actions
i: zoom in
o: zoom out
n: go north
e: go east
s: go south
w: go west
f: go forward in time
b: go backward in time
r: reset to initial state
h: hold active hover message (press h again to undo)
0: unzoom an area
d: toggle debugging flag
More details are provided in the rest of this documentation page, and in Section 4 of Kelley et al. (2021).

Usage

mapApp(
  age = argoDefaultIndexAge(),
  server = argoDefaultServer(),
  destdir = argoDefaultDestdir(),
  colLand = "lightgray",
  debug = 0
)

Arguments

age

numeric value indicating how old a downloaded file must be (in days), for it to be considered out-of-date. The default, argoDefaultIndexAge(), limits downloads to once per day, as a way to avoid slowing down a workflow with a download that might take a minute or so. Note that setting age=0 will force a new download, regardless of the age of the local file.

server

character value, or vector of character values, indicating the name of servers that supply argo data to be acquired with getIndex(). If not supplied, the default will be determined with argoDefaultServer(), which uses a value set by options("argoFloats.server"=URL) where URL is an appropriate URL, or "ifremer-https" if no such option was set.

destdir

character value indicating the directory in which to store downloaded files. The default value is to compute this using argoDefaultDestdir(), which returns ⁠~/data/argo⁠ by default, although it also provides ways to set other values using options(). Set destdir=NULL if destfile is a filename with full path information. File clutter is reduced by creating a top-level directory called data, with subdirectories for various file types; see “Examples”.

colLand

a colour specification for the land.

debug

integer value that controls how much information mapApp() prints to the console as it works. The default value of 0 leads to a fairly limited amount of printing, while higher values lead to more information. This information can be helpful in diagnosing problems or bottlenecks.

Details

mapApp() uses getIndex() to download index files from an Argo server the first time it runs. This can be slow, taking a minute or more, depending on the internet connection and load on the server. Once the index files are downloaded, mapApp() categorizes profiles as Core, BGC, or Deep (which may be displayed in any combination, using GUI elements).

The hi-res button will only affect the coastline, not the topography, unless there is a local file named topoWorldFine.rda that contains an alternative topographic information. Here is how to create such a file:

library(oce)
topoFile <- download.topo(west=-180, east=180,
                          south=-90, north=90,
                          resolution=10,
                          format="netcdf", destdir=".")
topoWorldFine <- read.topo(topoFile)
save(topoWorldFine, file="topoWorldFine.rda")
unlink(topoFile) # clean up

Value

mapApp has no return value, since it creates a shiny app by passing control to shiny::runApp(), which never returns.

Author(s)

Dan Kelley and Jaimie Harbin

References

Kelley, D. E., Harbin, J., & Richards, C. (2021). argoFloats: An R package for analyzing Argo data. Frontiers in Marine Science, (8), 636922. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3389/fmars.2021.635922")}

Examples

if (interactive()) {
    library(argoFloats)
    mapApp()
}


dankelley/argoFloats documentation built on April 18, 2024, 5:13 a.m.