aidR logo

Read and standardize data from automated insulin delivery systems

R package GPL-3 Last commit

Overview • Formats • Installation • Quick start • Documentation • Citation • Contributing • License • Contact


aidR is an open-source R package for reading and standardizing data exported from automated insulin delivery (AID) systems.

AID platforms differ in their file formats, variable names, units, timestamp conventions, and representation of clinically relevant events. aidR maps these heterogeneous exports to a common, analysis-ready format, allowing downstream analyses to be written once and applied consistently across AID systems.

What can aidR do?

aidR provides a common workflow for AID data:

Overview of the aidR workflow Overview of the aidR workflow

Supported export formats

aidR currently supports seven export formats:

Platform Export format Example AID systems
Glooko Folder with one CSV per data type CamAPS FX, Omnipod
CareLink (Medtronic) Single .xlsx or .csv export MiniMed 780G
mylife Cloud (Ypsomed) Single semicolon-delimited CSV CamAPS FX
Tidepool Multi-sheet .xlsx workbook Tandem Control-IQ, Loop, AAPS
YourLoops (Diabeloop) Folder with one CSV per data type DBLG1, DBLG2
Tandem Source Folder with one CSV per data type Tandem Control-IQ
Dexcom Clarity Single delimited CSV (CGM only) Any AID system using a Dexcom sensor

Installation

Install aidR directly from CRAN:

install.packages("aidR")

or get the latest version from github:

pak::pak("madleina/aidR")

Then load the package:

library(aidR)

Quick start

The main entry point is parse_data(), which reads a subject’s AID export and standardizes the major data types into a common format.

library(aidR)

data <- parse_data(
  id = "1",
  paths = "inst/extdata/glooko_example.zip"
)

names(data)
#> [1] "cgm"         "basal"       "bolus"       "SMBG"
#> [5] "carbs"       "total_basal" "total_bolus"

Visualizing AID data

plot_day() provides a daily overview of glucose, insulin delivery, carbohydrate entries, and SMBG measurements.

Example daily AID data visualization produced by aidR

Documentation

For a complete walkthrough — including supported export formats, filtering, quality checks, visualization, merging participants, and conversion to other formats — see the package vignette.

vignette("aidR")

Citation

A manuscript describing aidR and its design is currently in preparation.

If you use aidR in research, please cite the package and, once available, the accompanying publication.

citation("aidR")

Contributing

Contributions are welcome. In particular, we welcome support for new AID platforms and updates to existing parsers when export formats change.

Please use the GitHub issue tracker for bugs and feature requests.

[!IMPORTANT] When reporting parsing problems, do not upload identifiable patient data to a public GitHub issue.

License

aidR is open-source software licensed under the GNU General Public License v3.0 (GPL-3.0).

Contact

aidR is developed at the Diabetes Center Berne in Bern, Switzerland.

For questions, suggestions, or collaboration inquiries: datascience@dcberne.com


From heterogeneous AID exports to analysis-ready data.

↑ Back to top