View source: R/pr_latency_cross.R
pr_latency_cross | R Documentation |
Computes the latency to cross specific sequences of antennas consecutively
pr_latency_cross(
block_df,
block_ref_df,
sequence,
start_time,
end_time,
seq_position = 2,
unit = "m",
keep_NA = FALSE
)
block_df |
A data frame containing the reads from an experimental block |
block_ref_df |
A data frame containing a reference list with all individuals present in the experimental block. |
sequence |
Either a vector of antenna numbers/names, or a data frame containing several sequences of the same length (one vector per row), see examples. |
start_time |
The time from which the experimental block starts (i.e.POSIXct format, see examples). |
end_time |
The time until which the experimental block lasts (i.e.POSIXct format, see examples). |
seq_position |
Which antenna, from the sequence of antennas, should be crossed by an animal to calculate the latency?
By default, the first read at the second antenna is used to calculate the latency ( |
unit |
Unit of the latency duration: 'm' as default. |
keep_NA |
Logical argument. If the individuals are never read by the antenna(s), the latency might be set as the maximal possible value,
i.e. |
A data frame containing, for each sequence of interest, the latency of each individual to cross it entirely.
sequence_1 <- as.data.frame(rbind(
c(41, 42),
c(41, 43),
c(41, 44),
c(42, 41),
c(42, 43),
c(42, 44),
c(43, 41),
c(43, 42),
c(43, 44),
c(44, 41),
c(44, 42),
c(42, 43)
))
sequence_2 <- c(43, 42)
start_time <-
as.POSIXct(strptime(c("2020-11-05 12:30:00"), "%Y-%m-%d %H:%M:%OS"), "UTC")
end_time <-
as.POSIXct(strptime(c("2020-11-05 15:00:00"), "%Y-%m-%d %H:%M:%OS"), "UTC")
pr_latency_cross(block_df, block_ref_df, sequence_1, start_time, end_time)
pr_latency_cross(block_df, block_ref_df, sequence_2,
start_time, end_time, keep_NA = TRUE, unit = 's')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.