tag_label_stap: Create stationary periods from a tag label

View source: R/tag_label_stap.R

tag_label_stapR Documentation

Create stationary periods from a tag label

Description

This function computes the stationary periods from the pressure and/or acceleration label data. In most case, this function should be run directly after tag_label_read() in order to update tag to correspond to the new label file.

A stationary period is a period during which the bird is considered static relative to the spatial resolution of interest (~10-50km). They are defined by being separated by a flight of any duration (label "flight"). The stap_id is an integer value for stationary periods and decimal value for flight. The stap_id is added as a new column to each sensor data.

If an acceleration data.frame is present and contains a column label, the stationary period will be computed from it, otherwise, it uses the pressure data.frame.

Usage

tag_label_stap(
  tag,
  quiet = FALSE,
  warning_flight_duration = 2,
  warning_stap_duration = 6
)

Arguments

tag

a GeoPressure tag object.

quiet

logical to display warning message.

warning_flight_duration

Threshold of flight duration to display warning for (hours)

warning_stap_duration

Threshold of stationary period duration to display warning for (hours)

Value

tag is return with (1) a new data.frame of stationary periods tag$stap and (2) a new column stap_id for each sensor data.

See Also

GeoPressureManual

Other tag_label: tag_label(), tag_label_auto(), tag_label_read(), tag_label_write()

Examples

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

  tag <- tag_label_stap(tag)

  str(tag)

  str(tag$stap)
})

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