Nothing
knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.width = 7, fig.height = 4, message = FALSE, warning = FALSE ) library(cgmguru) # Availability flags used in chunk eval options iglu_available <- requireNamespace("iglu", quietly = TRUE) iglu_api_ok <- iglu_available
We use two CGM example datasets shipped with iglu:
example_data_5_subject: 5 subjectsexample_data_hall: 19 subjectsdata(example_data_5_subject, package = "iglu") data(example_data_hall, package = "iglu") # Base-R summaries (no external dependencies) summary_5 <- data.frame( rows = nrow(example_data_5_subject), subjects = length(unique(example_data_5_subject$id)), time_min = min(example_data_5_subject$time), time_max = max(example_data_5_subject$time), gl_min = min(example_data_5_subject$gl, na.rm = TRUE), gl_max = max(example_data_5_subject$gl, na.rm = TRUE) ) summary_5
cat("Note: The 'iglu' package is not available; vignette examples are skipped.\n")
iglu::episode_calculation() identifies hypo/hyperglycemia episodes.
iglu_episodes_5 <- iglu::episode_calculation( data = example_data_5_subject ) print(iglu_episodes_5)
iglu_episodes_hall <- iglu::episode_calculation( data = example_data_hall ) print(iglu_episodes_hall)
all_events_5 <- detect_all_events(example_data_5_subject, reading_minutes = 5) print(all_events_5)
all_events_hall <- detect_all_events(example_data_hall, reading_minutes = 5) print(all_events_hall)
We compare performance using microbenchmark on both datasets. Each benchmark contrasts iglu::episode_calculation() with cgmguru::detect_all_events().
library(microbenchmark) library(iglu) # example_data_5_subject bench_5 <- microbenchmark( episode_calculation = iglu::episode_calculation(example_data_5_subject), detect_all_events = cgmguru::detect_all_events(example_data_5_subject, reading_minutes = 5), times = 100, unit = "ms" ) print(bench_5) # example_data_hall (all subjects) bench_hall <- microbenchmark( episode_calculation = iglu::episode_calculation(example_data_hall), detect_all_events = cgmguru::detect_all_events(example_data_hall, reading_minutes = 5), times = 100, unit = "ms" ) print(bench_hall)
cat("Note: Installed 'iglu' version has a different 'episode_calculation' API; iglu examples are skipped.\n")
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.