Description Usage Arguments Examples
Plot activity values as a time series and periods as polygons.
1 2 3 4 5 6 7 8 9 10 11 | plot_activity_period(
agdb,
periods,
act_var,
start_var,
end_var,
color = "black",
fill = "#525252",
ncol = NULL,
nrow = NULL
)
|
agdb |
A |
periods |
A |
act_var |
The activity variable (unquoted) to plot on the y-axis. |
start_var |
The variable (unquoted) which indicates when the time periods start. |
end_var |
The variable (unquoted) which indicates when the time periods end. |
color |
Activity line color. |
fill |
Polygon fill color. |
ncol |
Number of rows and columns. Relevant only if the activity data is grouped. |
nrow |
Number of rows and columns. Relevant only if the activity data is grouped. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | data("gtxplus1day")
sub_gt3x <- gtxplus1day %>%
dplyr::filter(timestamp <= lubridate::as_datetime("2012-06-27 18:00:00"))
# Detect sleep periods using Sadeh as the sleep/awake algorithm
# and Tudor-Locke as the sleep period algorithm
periods_sleep <- sub_gt3x %>%
collapse_epochs(60) %>%
apply_cole_kripke() %>%
apply_tudor_locke(min_sleep_period = 60)
plot_activity_period(
sub_gt3x, periods_sleep, axis1,
in_bed_time, out_bed_time
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.