plot.tag: Plot a 'tag' object

View source: R/plot.tag.R

plot.tagR Documentation

Plot a tag object

Description

This function plot a GeoPressureR tag object as a time series or a map.

By default, type is determined in the following order of preference according to availability: c("map_pressure", "map_light"), "map_pressure", "map_light", "pressure".

plot.tag() calls different plotting functions depending on type.

  • "pressure": plot_tag_pressure()

  • "light": plot_tag_light()

  • "acceleration": plot_tag_acceleration()

  • "temperature": plot_tag_temperature()

  • "twilight": plot_tag_twilight()

  • "map_*" : plot.map() with ⁠tag$map_*⁠ as first argument.

Refers to these functions for additional parameters and more flexibility in the plotting.

Usage

## S3 method for class 'tag'
plot(x, type = NULL, ...)

Arguments

x

a GeoPressureR tag object.

type

type of the plot to display. One of "pressure", "acceleration", "light", "temperature", "twilight", "map", "map_pressure", "map_light", "map_pressure_mse", "map_pressure_mask", "mask_water". Map can be combined by providing a vector of type.

...

additional parameters for plot_tag_pressure(), plot_tag_acceleration(), plot_tag_light(), plot_tag_twilight() or plot.map()

Value

a plot, ggplotly or leaflet object.

Examples

withr::with_dir(system.file("extdata", package = "GeoPressureR"), {
  tag <- tag_create("18LX", quiet = TRUE) |>
    tag_label(quiet = TRUE) |>
    twilight_create() |>
    twilight_label_read()
})

# By default, plot will display the time series of pressure
plot(tag)
# Change the `type` to display other sensor
plot(tag, type = "acceleration")
plot(tag, type = "light")
# Twilight is display as an image
plot(tag, type = "twilight")

# After you compute any likelihood map, the default will
# become this map (i.e., `type = "map"`)
tag <- tag_set_map(tag,
  extent = c(-16, 23, 0, 50),
  scale = 4,
  known = data.frame(
    stap_id = 1,
    known_lon = 17.05,
    known_lat = 48.9
  )
) |>
  geopressure_map(quiet = TRUE)
plot(tag)
# The likelihood map of light can be display with
tag <- geolight_map(tag, quiet = TRUE)
plot(tag, type = "map_light")
# When both pressure and light likelihood are present,
# the default is to display their products, equivalent
# to choose `type = c("map_pressure", "map_light")`
plot(tag)

Rafnuss/GeoPressureR documentation built on April 17, 2025, 12:58 p.m.