nutrientIntakePlot: Visualize nutrient intake levels

Description Usage Arguments Value Examples

View source: R/Visualization_functions.R

Description

This function generates a barplot of nutrient intake levels, based on the output generated with the function dietBalance().

Usage

1
2
nutrientIntakePlot(daily_intake, color_scale = c("salmon", "cornflowerblue",
                   "palegreen3"), macronutrientsOnly = FALSE)

Arguments

daily_intake

list generated with the function dietBalance().

color_scale

character vector indicating the colors used to fill the bars, according to nutrient groups: macronutrient (first color), mineral (second color), vitamin (third color).

macronutrientsOnly

logical indicating if only macronutrients should be plotted. In the default behaviour, macronutrientsOnly = FALSE and all nutrients will be plotted, including minerals and vitamins.

Value

A barplot of nutrient intake levels, expressed as a percentage of RDA.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Load data
data(food_composition_data)
data(NHI_nutrient_recommendations)
data(nutrient_group)
data(sample_diet_USDA) ## contains an example of a one-week diet

## Get daily intake
balanceF <- dietBalance(my_daily_food = sample_diet_USDA,
                       food_database = "USDA", age = 27, gender = "female")

## Generate plot
nutrientIntakePlot(daily_intake = balanceF)

NutrienTrackeR documentation built on March 14, 2021, 5:09 p.m.