Skip to contents

GeoPressureViz is an interactive app to inspect and manually edit migration paths together with the underlying map likelihoods and pressure time series by stationary period. It is useful to compare pressure-, light- and distance-based information before finalizing a path.

The app can start from a tag object already in memory, or from an interim .RData/.rda file that contains at least tag (and optionally marginal, path_most_likely, pressurepath, pressurepath_most_likely).

When run_bg = FALSE, the app stores the current edited path in the Shiny option path_geopressureviz and returns it invisibly when the app closes. You can capture it from the return value of this function or retrieve it afterwards in the same R session with shiny::getShinyOption("path_geopressureviz").

When run_bg = TRUE, the function returns the background process object instead of the edited path.

The app Save button writes the current path to ./data/interim/{id}-path-geopressureviz.csv.

Learn more about GeoPressureViz in the GeoPressureManual .

Usage

geopressureviz(
  x,
  path = NULL,
  marginal = NULL,
  launch_browser = TRUE,
  run_bg = TRUE
)

Arguments

x

One of:

  • a GeoPressureR tag object;

  • a path to an existing .RData/.rda file;

  • a tag id (character scalar), interpreted as "./data/interim/{id}.RData".

path

Optional GeoPressureR path or pressurepath data.frame. If NULL, a path is resolved from available inputs in this order:

  • for file/id input (x character): path_most_likely (if present), then pressurepath (if present);

  • otherwise fallback to tag2path(tag, interp = 1).

marginal

map of the marginal probability computed with graph_marginal(). Overwrite the path or pressurepath contained in the .Rdata file.

launch_browser

If true (by default), the app runs in your browser, otherwise it runs on Rstudio.

run_bg

If true, the app runs in a background R session using the callr package. This allows you to continue using your R session while the app is running.

Value

When run_bg = FALSE: The edited path, returned invisibly when the app closes. During the app session, the current path is also stored in the Shiny option shiny::getShinyOption("path_geopressureviz"), which can be read afterwards in the same R session. When run_bg = TRUE: The background process object. In this case the edited path is not returned to the calling console session.

Examples

if (FALSE) {
  geopressureviz("18LX")
}