Description Usage Arguments Value Examples
View source: R/create_day_data.R
Summarize Actigraphy Data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | summarize_daily_actigraphy(
x,
units = "1 min",
fix_zeros = TRUE,
fill_in = TRUE,
verbose = TRUE,
...
)
summarise_daily_actigraphy(
x,
units = "1 min",
fix_zeros = TRUE,
fill_in = TRUE,
verbose = TRUE,
...
)
summarize_actigraphy(
x,
units = "1 min",
.fns = list(mean = mean, median = median),
verbose = TRUE,
...
)
summarise_actigraphy(
x,
units = "1 min",
.fns = list(mean = mean, median = median),
verbose = TRUE,
...
)
|
x |
an AccData object. If 'x' is a character, then
|
units |
units to group the data to take the statistic over |
fix_zeros |
Should |
fill_in |
if |
verbose |
print diagnostic messages |
... |
Additional arguments to pass to
|
.fns |
Functions to apply to each of the selected columns.
See |
A tsibble
object, with 86400 rows,
with one row for each secon d of the day '24*60*60'.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | url = "https://github.com/THLfi/read.gt3x/files/3522749/GT3X%2B.01.day.gt3x.zip"
destfile = tempfile(fileext = ".zip")
dl = utils::download.file(url, destfile = destfile)
gt3x_file = utils::unzip(destfile, exdir = tempdir())
gt3x_file = gt3x_file[!grepl("__MACOSX", gt3x_file)]
path = gt3x_file
x = read_actigraphy(path)
library(dplyr)
library(lubridate)
options(digit.secs = 2)
daily = summarize_daily_actigraphy(x)
average_day = summarize_actigraphy(x)
## Not run:
if (requireNamespace("ggplot2", quietly = TRUE)) {
library(magrittr)
average_day %>%
ggplot(aes(x = time, y = ai_mean)) +
geom_line()
average_day %>%
ggplot(aes(x = time, y = ai_median)) +
geom_line()
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.