| filter_carbs | R Documentation |
Removes carbohydrate entries that were overwritten by another entry.
filter_carbs(data_id, max_minutes_overwrite = 2)
data_id |
A list with all data found for one individual. Filtering is only performed if the carbohydrate and bolus data were cleaned and standardized. |
max_minutes_overwrite |
Maximum time difference (in minutes) between an overwritten entry and another entry. Default 2 minutes. If NULL, nothing is removed. |
In the bolus calculator, carbs may be entered, but the bolus may not be delivered (or cancelled), and the carbs may then be entered again, with a bolus shortly after. Some platforms (e.g. Glooko) export all of these entries.
A carbohydrate entry is removed if
its bolus is zero (found via link_id)
another carbohydrate entry of the same format (or sharing
one, for combined formats such as "glooko/tidepool"), with a
different link_id, lies at most max_minutes_overwrite
minutes before or after it.
it is not flagged as a hypo treatment (is_hypo_treatment).
Slowly absorbed carbohydrates merged during cleaning (linked entries with an
estimated_absorption_duration, see clean.glooko) are
never removed and do not count as another entry. The zero bolus linked to a
removed entry is removed from the bolus data as well.
A list with all data found for one individual, filtered, if
necessary. Removed rows are stored in the attribute removed, see
removed_entries().
path <- system.file("extdata", "glooko_example.zip", package = "aidR")
data <- parse_data(id = "1", paths = path)
nrow(data$carbs)
data_filtered <- filter_carbs(data)
nrow(data_filtered$carbs)
removed_entries(data_filtered)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.