| clean.glooko | R Documentation |
Slowly absorbed carbohydrates. In CamAPS, users can flag
carbohydrates as slowly absorbed (over 3 to 4 hours). Glooko exports such an
intake as a series of equal-sized entries, one every 30 minutes. Because
these entries are not separate intakes, this function merges them back into a single
entry if merge_slow_carbs = TRUE. This keeps the data consistent with
export platforms that do not split slowly absorbed carbohydrates (e.g.
mylife), so that later filtering and duplicate detection across platforms
work correctly.
## S3 method for class 'glooko'
clean(data, id, merge_slow_carbs = TRUE, ...)
data |
An instance of class |
id |
Character or numeric participant identifier. |
merge_slow_carbs |
Logical, if |
... |
Additional arguments passed to methods. |
A series is merged if
all entries have the same amount,
each entry lies 30 +/- 5 minutes after the previous one (unrelated entries in between are ignored), and
the series consists of exactly 6, 7, or 8 entries (corresponding to 2 to 3 hours absorption time, every 30 minutes).
The merged entry takes the time and link_id of the first entry. Its
amount is the sum of all entries, and estimated_absorption_duration
is set to 0.5 hours per entry (e.g. 3 hours for 6 entries). The zero-unit
boluses linked to the other entries are removed. All removed rows are
stored in the attribute removed; see removed_entries.
A named list with the cleaned data, named according to the data type
of data: cgm, basal, bolus and carbs
(both are extracted from the bolus file), total_basal and
total_bolus (both are extracted from the daily aggregated insulin
file) or SMBG. NULL for all other data types, which are not
cleaned.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.