aidR: Dexcom Clarity export format

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(aidR)
path <- system.file("extdata", "dexcom_clarity_example.csv", package = "aidR")

Overview

A Dexcom Clarity export is a single delimited .csv file with 14 columns. It begins with a short metadata block, which includes the name and date of birth of the user and then, for every device that uploaded data, its device name, its sensor, and its alert settings. The metadata block is followed by one row per recorded event:

writeLines(readLines(path, n = 80))

The column headers and the metadata labels are language-specific (the example above is German) and vary with the language of the user's account. The separator varies with it as well, as exports use either a comma , or a semicolon ;.

Unlike the other supported platforms, Dexcom Clarity is a CGM platform rather than an AID platform, so an export contains CGM data only and no basal, bolus, carbohydrate, or SMBG data.

How aidR detects this format

Because the headers are language-specific, aidR cannot identify a Dexcom Clarity file from its header names. It relies instead on the structure of the file, trying both , and ; as the separator and accepting the one under which all three of the following hold:

aidR then retrieves the relevant columns by index rather than by name: the timestamp (column 2), the event type (column 3), the source device (column 7), the glucose value (column 8), and the transmitter id (column 14).

Entries and the data types they produce

To inspect the raw entries, we parse the export with clean = FALSE, which returns the full information provided by Dexcom Clarity:

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

Only the EGV rows are retained.

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 | |-------------------|------------------------------|--------------------------------------------------------------| | cgm | dexcom_clarity_example.csv | All rows whose event type is EGV, i.e. the sensor readings. |

data_clean <- parse_data(id = "1", paths = path)
head(data_clean$cgm)

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.