View source: R/tag_label_auto.R
tag_label_auto | R Documentation |
tag
This function uses acceleration data to classify migratory flights. The function uses a
k=2
mean clustering (kmeans()
) to identify high activity periods. Periods of high activity
lasting more than min_duration
are then considered to be migratory flight.
tag_label_auto(
tag,
min_duration = 30,
thr_reclassify = 0.1,
post_proc_window = 2
)
tag |
a GeoPressure |
min_duration |
Minimal duration (in minutes) to consider a high activity as migratory flight. |
thr_reclassify |
Post-processing threshold of activity considered for re-classification.
Typically between |
post_proc_window |
Post-processing windows considered for re-classification. Typically |
Additionally, we perform a post-processing step to improve the classification of low-activity period happening during a migration flight (e.g. gliding phase):
Mid-activity surrounded by flights. The kmeans classification classify high-activity all
values above 50% of the distance between the two clusters. Here, we classify as mid-activity
non-flight activity data which value are greater than thr_reclassify
of the distance between
the two kmeans clusters. Any periods of mid-activity surrounded by flight are also considered
as flights.
To avoid stap lasting only a few datapoints, we also classify any datapoint
which is surrounded by a flight before and after, within a window of +/- post_proc_window
points. As a result, no stap will be shorter than (2 * post_proc_window + 1) * dt
.
This function is inspired by the function classify_flap
from the
PAMlr package.
Same data logger list than input tag
, but with the column label
filled with
"flight"
in the acceleration data.frame when a sustained high-activity period is detected.
Other tag_label:
tag_label()
,
tag_label_read()
,
tag_label_stap()
,
tag_label_write()
withr::with_dir(system.file("extdata", package = "GeoPressureR"), {
tag <- tag_create("18LX", quiet = TRUE)
tag <- tag_label_auto(tag, min_duration = 15)
str(tag$acceleration)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.