plot_food: Plot Glucose Level Changes Over Time

View source: R/food_by_meal.R

plot_foodR Documentation

Plot Glucose Level Changes Over Time

Description

This function creates a line plot of glucose level changes over time. The changes are colored by meals. The function includes a grey rectangle behind the line plot for contrast.

Usage

plot_food(foodresults = NULL, foodname = "Food")

Arguments

foodresults

A dataframe, usually the result of a call to food_times_df. The dataframe should have the following columns:

  • t: a numeric vector representing time.

  • value: a numeric vector representing glucose level changes.

  • meal: a character vector representing meal names. If NULL, the function will return NULL. Default is NULL.

foodname

a string representing the name of the food to plot. Note: this is for display only; it does not filter or otherwise generate different results.

Value

A ggplot object representing the line plot of glucose level changes over time.


personalscience/cgmr documentation built on July 2, 2023, 12:47 a.m.