The classic chronobiology double-plot format. Each recording day is drawn twice: in the left column of its own row (x = 00:00 to 24:00) and in the right column of the row above (x = 24:00 to 48:00). This means consecutive pairs of days share a row, making circadian phase drift visible as a diagonal band across rows.
Usage
plot_actogram_double(
result,
tz = NULL,
title = NULL,
colours = NULL,
date_label_every = 7L,
epoch_min = 1,
base_size = 13
)Arguments
- result
A
zeitr_resultlist (fromrun_pipeline()orrun_pipeline_native()), or a tibble with at leastdatetimeandstatecolumns.- tz
character(1)orNULL. Timezone for date and time-of-day extraction.NULL(default) auto-detects from the timezone attribute embedded in thedatetimePOSIXct column; falls back to"UTC"when absent.- title
character(1)orNULL. Plot title.NULLconstructs"Actogram \u2014 <subject_id>"fromresult$subject_idwhen available.- colours
Named character vector mapping state labels (
"wake","sleep","nap","off-wrist") to hex colours.NULLusesactogram_colours().- date_label_every
integer(1). Label every Nth row on the y-axis. Default7(weekly ticks).- epoch_min
numeric(1). Epoch duration in minutes. Used as the tile width inggplot2::geom_tile(). Default1(ActTrust standard).- base_size
numeric(1). Base font size passed toggplot2::theme_minimal(). Default13.
Details
Row \(i\) shows day \(i\) on the left and day \(i+1\) on the right. Every day therefore appears twice in the plot (except the first, which has no left-column predecessor, and the last, which has no right-column successor). A dashed vertical line marks the 24 h boundary between the two columns.
Examples
if (FALSE) { # \dontrun{
result <- run_pipeline("recordings/P001.txt", tz = "America/Sao_Paulo")
plot_actogram_double(result)
} # }