View source: R/create_day_inclusion.R
create_day_inclusion | R Documentation |
Create Day-Level Inclusion information
create_day_inclusion(df, min_required = 1368L)
df |
A 'data.frame' with the columns 'time' |
min_required |
Number of minutes required in a day to be called 'included' |
A 'data.frame' for each day with information of number of minutes observed and included
file = system.file("extdata", "TAS1H30182785_2019-09-17.gt3x",
package = "SummarizedActigraphy")
df = read_actigraphy(file)
df = df$data
df = df %>%
dplyr::mutate(r = sqrt(X^2 + Y^2 + Z^2),
time = lubridate::floor_date(time, "1 minute")) %>%
dplyr::group_by(time) %>%
dplyr::summarise(r = sum(r), .groups = "drop") %>%
dplyr::mutate(wear = r > 4000)
res = create_day_inclusion(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.