create_day_inclusion: Create Day-Level Inclusion information

View source: R/create_day_inclusion.R

create_day_inclusionR Documentation

Create Day-Level Inclusion information

Description

Create Day-Level Inclusion information

Usage

create_day_inclusion(df, min_required = 1368L)

Arguments

df

A 'data.frame' with the columns 'time'

min_required

Number of minutes required in a day to be called 'included'

Value

A 'data.frame' for each day with information of number of minutes observed and included

Examples

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)

muschellij2/SummarizedActigraphy documentation built on Aug. 12, 2024, 5:35 p.m.