bb_summarize: Summarize Biobank Acceleration File

Description Usage Arguments Value Examples

View source: R/bb_summarize.R

Description

Summarize Biobank Acceleration File

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
bb_summarize(
  df,
  unit = "1 minute",
  summarize_func = "mean",
  na.rm = TRUE,
  keep_imputed = TRUE,
  ...
)

bb_summarise(
  df,
  unit = "1 minute",
  summarize_func = "mean",
  na.rm = TRUE,
  keep_imputed = TRUE,
  ...
)

bb_summarize_minute(..., unit = "1 minute")

Arguments

df

A data.frame or tbl from bb_read

unit

unit of summarization, passed to floor_date

summarize_func

Function to use for summarization, passed to summarize

na.rm

Should NAs be removed?

keep_imputed

Should the imputed values be kept in this data set before summarization

...

Additional arguments to pass to summarize_func

Value

A summarized tbl

Examples

1
2
3
4
5
6
file = system.file("test2.csv", package = "biobankr")
df = bb_read(file)
collapsed = bb_summarize(df, unit = "10 seconds")
collapsed = bb_summarize(df, unit = "10 seconds", summarize_func = "median")
collapsed = bb_summarize(df, unit = "15 seconds",
summarize_func = "quantile", probs = 0.25)

muschellij2/biobankr documentation built on April 13, 2020, 7:33 a.m.