summary_glu {iglu} | R Documentation |
Calculate summary glucose level
Description
The function 'summary_glu' is a wrapper for the base function 'summary()'. Output is a tibble object with subject id and the summary value: Minimum, 1st Quantile, Median, Mean, 3rd Quantile and Max.
Usage
summary_glu(data)
Arguments
data |
DataFrame object with column names "id", "time", and "gl", or numeric vector of glucose values. |
Details
A tibble object with 1 row for each subject, a column for subject id and a column for each of summary values is returned. 'NA' glucose values are omitted from the calculation of the summary values.
Value
If a DataFrame object is passed, then a tibble object with a column for subject id and then a column for each summary value is returned. If a vector of glucose values is passed, then a tibble object without the subject id is returned. 'as.numeric()' can be wrapped around the latter to output a numeric vector with values in order of Min, 1st Quantile, Median, Mean, 3rd Quantile and Max.
Examples
data(example_data_1_subject)
summary_glu(example_data_1_subject)
data(example_data_5_subject)
summary_glu(example_data_5_subject)