dot-create_link_id.aidR: Create a key linking bolus and carbohydrate entries of the...

.create_link_id.aidRR Documentation

Description

Some exports record which carbohydrate entry triggered which bolus based on information from the bolus calculator. To keep this link after splitting the data when cleaning, a unique identifier is created that is stored in both bolus and carbs (no link is encoded as NA).

Usage

.create_link_id.aidR(id, ..., linked = TRUE)

Arguments

id

Participant identifier.

...

One or more vectors of equal length, with one element per event, which together describe the event.

linked

Logical vector with one element per event (or a single value), TRUE if the event links a bolus to a carbohydrate entry. All other events get NA.

Details

The key is built from the content of the event and consists of the participant id and the fields passed in ... (e.g. timestamp and amounts), separated by "|". Events that are identical in all fields are numbered in the order they appear in the export, which makes the key unique by construction. Identifiers given by the export are only used to find out which entries belong together, never as the key itself.

Value

A character vector with one key per event, NA where linked is not TRUE.


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