food_with_intervention: Add intervention column to data frame

food_with_interventionR Documentation

Add intervention column to data frame

Description

This function adds a new logical column to a tibble, named "control". The value in this column will be TRUE if the specified intervention string is found within the 'meal' column of the data frame, and FALSE otherwise. The string detection is case-insensitive.

Usage

food_with_intervention(df, intervention = "glucotrojan")

Arguments

df

A data frame (or tibble) to which the 'control' column will be added.

intervention

A string to be searched for within the 'meal' column of the input data frame. Defaults to "glycotrojan".

Value

A tibble that is the same as the input tibble, but with an added 'control' column.


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