centroidLE: Centroid of light exposure

View source: R/centroidLE.R

centroidLER Documentation

Centroid of light exposure

Description

This function calculates the centroid of light exposure as the mean of the time vector weighted in proportion to the corresponding light intensity.

Usage

centroidLE(lightVar, timeVar, bin_size = NULL, as_df = TRUE)

Arguments

lightVar

Numeric vector containing the light data.

timeVar

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

bin_size

Numeric value or character specifying size of bins to average light data. If timeVar is POSIXct it must be a string with the time followed by its unit (e.g., "1 hour", "30 mins"). If NULL then no binning will be performed. Defaults to NULL.

as_df

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

Value

Single column data frame or vector.

References

Phillips, A. J. K., Clerx, W. M., O’Brien, C. S., Sano, A., Barger, L. K., Picard, R. W., Lockley, S. W., Klerman, E. B., & Czeisler, C. A. (2017). Irregular sleep/wake patterns are associated with poorer academic performance and delayed circadian and sleep/wake timing. Scientific Reports, 7(1), 3216. https://doi.org/10.1038/s41598-017-03171-4


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