aidR: CareLink export format

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(aidR)

Overview

path <- system.file("extdata", "carelink_example.csv", package = "aidR")

A CareLink (Medtronic) export is a single semicolon-delimited .csv (or .xlsx) file. The file is divided into sections separated by marker rows of the form -------;MiniMed 780G MMT-1886;Pump;XXXXXXXXXX;-------. Each section has its own header row and its own set of columns:

writeLines(readLines(path, n = 10))

How aidR detects this format

aidR identifies a CareLink export by the keyword MiniMed in the first line.

Sections and the data types they produce

To inspect the files, we parse the export with clean = FALSE, which returns the full information provided by CareLink:

data <- parse_data(id = "1", paths = path, clean = FALSE)

Because all information is present in one file, most of the parsing work happens up front: the file is split into sections, and the large "Pump" section is then split further into individual event types based on which columns are populated on each row.

The list below describes the different sections and the information we can get from it.

r head(data$scheduled_basal_rates)

r head(data$bolus)

r head(data$bwz)

r head(data$SMBG)

r head(data$alerts)

r head(data$prime)

r head(data$temp_basal)

r head(data$corr_bolus_info)

r head(data$sensor_calibration)

r head(data$insulin_action_curve)

r head(data$device_changes)

head(data$aggr_auto_insulin)
head(data$cgm)

Cleaning files

When parse_data is run with clean = TRUE, the cleaned data types are built from the following raw files and attributes:

| Cleaned data type | Used files | Used attributes of clean = FALSE | |-------------------|------------------------|-----------------| | cgm | carelink_example.csv | data$cgm | | bolus | carelink_example.csv | data$bolus | | carbs | carelink_example.csv | data$bwz | | SMBG | carelink_example.csv | data$SMBG | | total_bolus | carelink_example.csv | data$bolus |

Note that a CareLink export contains no usable basal data - cgm, bolus, carbs, and SMBG are the core data types available from this platform (see the notes below).

Notes



Try the aidR package in your browser

Any scripts or data that you put into this service are public.

aidR documentation built on Oct. 28, 2026, 5:13 p.m.