tag_label: Label a 'tag' object

View source: R/tag_label.R

tag_labelR Documentation

Label a tag object

Description

This function performs the following operations:

  1. Read label file with tag_label_read() and assign the label to a new column in each sensor data.frame

  2. Compute the stationary period tag$stap from the label and assign the corresponding stap_id on all sensors data.frame with tag_label_stap()

If the label file does not exist, the function will suggest to create it with tag_label_write() and use tag_label_auto() if acceleration data exists.

Usage

tag_label(
  tag,
  file = glue::glue("./data/tag-label/{tag$param$id}-labeled.csv"),
  quiet = FALSE,
  ...
)

Arguments

tag

a GeoPressure tag object.

file

Absolute or relative path of the label file.

quiet

logical to display message.

...

Arguments passed on to tag_label_stap

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

Same tag list with

(1) a stap data.frame describing the STAtionary Period:

  • stap_id unique identifier in increasing order 1,...,n

  • start start date of each stationary period

  • end end date of each stationary period

(2) an additional label and stap_id column on the sensor data.frame:

  • date datetime of measurement as POSIXt

  • value sensor measurement

  • label indicates the observation to be discarded ("discard" and "flight") as well as grouped by elevation layer (⁠elev_*⁠)

  • stap_id stationary period of the measurement matching the tag$stap.

See Also

GeoPressureManual

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

Examples

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

  print(tag)

  tag <- tag_label(tag)

  print(tag)

  # The labelled `tag` contains additional column on the sensor data.frame
  str(tag)
})


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