View source: R/ActCosinor_long.R
ActCosinor_long | R Documentation |
A parametric approach to study circadian rhythmicity assuming cosinor shape.This function is a whole dataset
wrapper for ActCosinor
.
ActCosinor_long(count.data, window = 1, export_ts = FALSE)
count.data |
|
window |
The calculation needs the window size of the data. E.g window = 1 means each epoch is in one-minute window. |
export_ts |
A Boolean to indicate whether time series should be exported (notice: it takes time and storage space to export time series data for all subject-days. Use this with caution. Suggest to only export time series for selected subjects) |
A data.frame
with the following 5 columns
ID |
ID |
ndays |
number of days |
mes |
MESRO, which is short for midline statistics of rhythm, which is a rhythm adjusted mean. This represents mean activity level. |
amp |
amplitude, a measure of half the extend of predictable variation within a cycle. This represents the highest activity one can achieve. |
acro |
acrophase, a meaure of the time of the overall high values recurring in each cycle. Here it has a unit of radian. This represents time to reach the peak. |
acrotime |
acrophase in the unit of the time (hours) |
ndays |
Number of days modeled |
and
cosinor_ts |
Exported data frame with time, time over days, original time series, fitted time series using cosinor model |
counts_1 = example_activity_data$count[c(1:12),] cos_all_1 = ActCosinor_long(count.data = counts_1, window = 1,export_ts = TRUE) counts_10 = cbind(counts_1[,1:2], as.data.frame(t(apply(counts_1[,-c(1:2)], 1, FUN = bin_data, window = 10, method = "average")))) cos_all_10 = ActCosinor_long(count.data = counts_10, window = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.