| filter_CGM | R Documentation |
Filter CGM values
filter_CGM(
data_id,
truncate_min_cgm = 40,
truncate_max_cgm = 400,
min_minutes_difference_cgm = 5
)
data_id |
A list with all data found for one individual. Filtering is only performed if the CGM data was cleaned and standardized. |
truncate_min_cgm |
CGM values smaller than this threshold will be truncated. Default 40 mg/dL, if NULL, no filtering is performed. |
truncate_max_cgm |
CGM values larger than this threshold will be truncated. Default 400 mg/dL, if NULL, no filtering is performed. |
min_minutes_difference_cgm |
CGM values are downsampled to this time interval (in minutes). Default 5 minutes, if NULL, no downsampling is performed. |
A list with all data found for one individual, filtered, if necessary.
path <- system.file("extdata", "tandem_source_example.zip", package = "aidR")
# Read data
data <- parse_data(id = "1", paths = path)
range(data$cgm$value)
length(data$cgm$value)
# Truncate to 40-400 mg/dL and downsample to 5-minute intervals
data_filtered <- filter_CGM(data)
range(data_filtered$cgm$value)
length(data_filtered$cgm$value)
# Truncate only, without downsampling
data_truncated <- filter_CGM(data, min_minutes_difference_cgm = NULL)
range(data_truncated$cgm$value)
length(data_truncated$cgm$value)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.