Description Usage Arguments Details Value Examples
The function quantile_glu is a wrapper for the base function quantile(). Output is a tibble object with columns for subject id and each of the quantiles.
1 | quantile_glu(data, quantiles = c(0, 25, 50, 75, 100))
|
data |
DataFrame object with column names "id", "time", and "gl", or numeric vector of glucose values. |
quantiles |
List of quantile values between 0 and 100. |
A tibble object with 1 row for each subject, a column for subject id and a column for each quantile is returned. NA glucose values are omitted from the calculation of the quantiles.
The values are scaled from 0-1 to 0-100 to be consistent in output with above_percent, below_percent, and in_range_percent.
The command quantile_glu(...) / 100 will scale each element down from 0-100 to 0-1.
If a data.frame object is passed, then a tibble object with a column for subject id and then a column for each quantile 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.
1 2 3 4 5 6 7 8 9 | data(example_data_1_subject)
quantile_glu(example_data_1_subject)
quantile_glu(example_data_1_subject, quantiles = c(0, 33, 66, 100))
data(example_data_5_subject)
quantile_glu(example_data_5_subject)
quantile_glu(example_data_5_subject, quantiles = c(0, 10, 90, 100))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.