irinagain / iglu

R package for Interpreting GLUcose data from CGMs (Continuous Glucose Monitors)
https://irinagain.github.io/iglu/
22 stars 26 forks source link

allow relevant metrics to be calculated in mmol/l and report in mmol/l #151

Open mitchjduncan opened 5 months ago

mitchjduncan commented 5 months ago

Hi Wondering if there is any plan to implement the ability to process data using glucose values in mmol/L and report on these in mmol/L for the relevant metrics? This would be useful for users in countries that use mmol/l and not mg. Metrics related to time in ranges would require the thresholds and the units to be specified. Thanks Mitch

irinagain commented 5 months ago

Hi, Thank you for your patience. By default, all calculations are performed in mg/dL, but the process_data function can be used for automatic conversion if the glucose column has mmol in its name (it will convert the data from mmol/L to mg/dL). I am also looking at your other feature request by email, and will respond soon.

Regarding mmol/L, please let me know if the above solution works for you. If not, would you prefer to have explicit mmol/L to mg/dL conversion as a function? this is something we can definitely add

mitchjduncan commented 5 months ago

Hi thanks for getting back to me. I am interesting in reporting using mmol as the metric rather than converting mmol to mg prior to processing by the package. An example is gmi, I have just sent a pull request outlining a suggestion to do this. This would be useful for other metrics and the AGP where reporting in mmol is useful for the clinical setting. Let me know if you think useful.