sugar.over.time {sugaR} | R Documentation |
This function prepares a single plot that presents all information gathered from up to a week on a single page on blood glucose levels (lines connecting consecutive measurements) carbohydrate uptake (spots with area or radius indicating amount), insulin dosage (bar in thermometers), physical activity (width of lines) and the basal rate (optional for insulin pump carriers).
sugar.over.time(data.glucose,data.basal=NULL,data.intake=NULL, data.activities=NULL,data.factors=NULL,data.events=NULL, symbol="thermometer",col=rainbow, represent.carbohydrates.by.area=TRUE, threshold.low=80, threshold.high=140, labels.language="english",labels.type="kids", debug=FALSE )
data.glucose |
list of days with (nx2) matrix of (time, glucose level) pairs |
data.basal |
list of days with (nx2) matrix of (duration, units insulin per hour) pairs |
data.intake |
list of days with (nx4) matrix of (time,carbohydrates, units insulin for food, units insulin to correct hyperglucemiar) quadruples |
data.activities |
list of days with list of list with f=start of activity, t=end of activity, a=degree of activity (a number from 1 (weak) to 5 (strong)), c=free text as comment |
data.events |
list of days with list of list with t=time of event, e=the event itself, plot=binary indicating if the event shall be shown in the plot |
data.factors |
list of days at which factors were changed. Every list entry is a (nx2) matrix of (time,factor) pairs. |
symbol |
The symbol to be used for displaying glucose data. The default are thermometers, which allow the co-presentation of insulin dosage. An alternative are circles. Either represents the amount of carbohydrate intake by the size of the symbol. |
col |
function emitting a series of colors to help distinguishing days |
represent.carbohydrates.by.area |
Indicates if the area (default) or the radius should represent the carbohydrates taken in. |
threshold.low |
Glucose concentration no longer considered too low |
threshold.high |
Upper-most tolerable Glucose concentration |
debug |
Informs about internal states. |
labels.language |
Currently supported are 'english' and 'german'. |
labels.type |
Currently supported are 'kids' and 'adults'. |
.
There is yet no standardised interface to support the data entry. For
the time speaking, the plan is to provide interfaces to existing tools
external to R that read out glucose meters or insulin pumps for this
matter. However, at least for the activity data sugar.over.time
seems to be unique. Until a more practical solution is available,
the user is kindly asked to enter the data manually as demonstrated
in the example.
To bring the plot to paper, it is suggested to execute
postscript("filename.ps",format="A4",horizontal=FALSE)
sugar.over.time(...)
dev.off()
The printing should be performed via postscript
, not via the now more common pdf
, since postscript
will use the full page when invoked. When not printing the basal rate (or when you have many different profiles) one may prefer adding horizontal=TRUE
as an argument to the postscript function.
Steffen Moeller steffen_moeller@gmx.de
## retrieving readily prepared input data data(diabetesDiary) ## invoking the plot sugar.over.time(data.glucose=myGlucose, data.basal=myBasal, data.intake=myIntake, data.activities=myActivities, data.factors=myFactors)