This function plots 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"), then the first available map ("map_pressure",
"map_light", ...), then the first available sensor ("pressure", "light", ...).
plot.tag() calls different plotting functions depending on type.
"pressure":plot_tag_pressure()"light":plot_tag_light()"acceleration":plot_tag_acceleration()"temperature","temperature_external","temperature_internal":plot_tag_temperature()"twilight":plot_tag_twilight()"actogram":plot_tag_actogram()"map_*":plot.map()withtag$map_*as first argument.
Refer 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
tagobject.- type
type of the plot to display. One of
"pressure","acceleration","light","temperature","twilight","actogram","map","map_pressure","map_light","map_pressure_mse","map_pressure_mask","temperature_external","temperature_internal". Map can be combined by providing a vector of type.- ...
additional parameters for
plot_tag_pressure(),plot_tag_acceleration(),plot_tag_light(),plot_tag_temperature(),plot_tag_twilight(),plot_tag_actogram()orplot.map(). For twilight and actogram plots, useflip_axes = TRUEto place time horizontally anddouble_plot = TRUEfor a 48-hour double plot.
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 sensors
plot(tag, type = "acceleration")
plot(tag, type = "light")
plot(tag, type = "temperature")
plot(tag, type = "twilight")
plot(tag, type = "actogram")
# After you compute any likelihood map, the default will become this map (i.e., `type = "map"`).
# When both pressure and light likelihood are present, the default is to display their product,
# equivalent to `type = c("map_pressure", "map_light")`
withr::with_dir(system.file("extdata", package = "GeoPressureR"), {
tag <- load_interim("18LX", var = "tag")
})
plot(tag)
plot(tag, type = "map_pressure")
plot(tag, type = "map_light")
