xlit: Mean/first/last timing above/below threshold.

xlitR Documentation

Mean/first/last timing above/below threshold.

Description

These functions calculate the mean/first/last timepoint where light levels are above or below a given threshold intensity within the given interval.

Usage

mlit(lightVar, timeVar, threshold, as_df = TRUE, wide = TRUE)

flit(lightVar, timeVar, threshold, as_df = TRUE, wide = TRUE)

llit(lightVar, timeVar, threshold, as_df = TRUE, wide = TRUE)

Arguments

lightVar

Numeric vector containing the light data.

timeVar

Vector containing the time data. Can be POSIXct or numeric.

threshold

Single numeric value or vector specifying threshold intensities. The sign indicates above/below (see threshold).

as_df

Logical. Should the output be returned as a data frame? Defaults to TRUE.

wide

Logical. Should the output be returned in wide format? Defaults to TRUE.

Details

'mlit()' calculates the mean timing of light above/below threshold.

'flit()' calculates the first timing of light above/below threshold.

'llit()' calculates the last timing of light above/below threshold.

Value

Data frame or matrix with pairs of threshold and calculated values. If wide is TRUE then variable names will be concatenated with the threshold.

References

Reid, K. J., Santostasi, G., Baron, K. G., Wilson, J., Kang, J., & Zee, P. C. (2014). Timing and Intensity of Light Correlate with Body Weight in Adults. PLOS ONE, 9(4), e92251. https://doi.org/10.1371/journal.pone.0092251


steffenhartmeyer/lightdosimetry documentation built on Jan. 29, 2024, 12:48 p.m.