View source: R/metric_intradaily_variability.R
intradaily_variability | R Documentation |
This function calculates the variability of consecutive Light levels within a 24h day. Calculated as the ratio of the variance of the differences between consecutive Light levels to the total variance across the day. Calculated with mean hourly Light levels. Higher values indicate more fragmentation.
intradaily_variability(
Light.vector,
Datetime.vector,
na.rm = FALSE,
as.df = FALSE
)
Light.vector |
Numeric vector containing the light data. |
Datetime.vector |
Vector containing the time data. Must be POSIXct. |
na.rm |
Logical. Should missing values be removed? Defaults to |
as.df |
Logical. Should the output be returned as a data frame? If |
Numeric value or dataframe with column 'IV'.
Van Someren, E. J. W., Swaab, D. F., Colenda, C. C., Cohen, W., McCall, W. V., & Rosenquist, P. B. (1999). Bright Light Therapy: Improved Sensitivity to Its Effects on Rest-Activity Rhythms in Alzheimer Patients by Application of Nonparametric Methods. Chronobiology International, 16(4), 505–518. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3109/07420529908998724")}
Hartmeyer, S.L., Andersen, M. (2023). Towards a framework for light-dosimetry studies: Quantification metrics. Lighting Research & Technology. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1177/14771535231170500")}
Other metrics:
bright_dark_period()
,
centroidLE()
,
disparity_index()
,
duration_above_threshold()
,
exponential_moving_average()
,
frequency_crossing_threshold()
,
interdaily_stability()
,
midpointCE()
,
nvRC()
,
nvRD()
,
nvRD_cumulative_response()
,
period_above_threshold()
,
pulses_above_threshold()
,
threshold_for_duration()
,
timing_above_threshold()
set.seed(1)
N <- 24 * 2
# Calculate metric for two 24 h days with two measurements per hour
dataset1 <-
tibble::tibble(
Id = rep("A", N * 2),
Datetime = lubridate::as_datetime(0) + c(lubridate::minutes(seq(0, N * 60 - 30, 30))),
MEDI = sample(1:1000, N * 2)
)
dataset1 %>%
dplyr::summarise(
"Intradaily variability" = intradaily_variability(MEDI, Datetime)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.