nutrient: Get the sum of a single nutrient from a nutrition object

Description Usage Arguments Examples

View source: R/nutrient.R

Description

Gets the sum of a single nutrient from a nutrition object. For example, gets the total calories or total fat. For a list of nutrients available, see 'data(nutrients)'.

Usage

1

Arguments

obj

The nutrition object – a list returned by the 'nutritionix_lookup()' function.

nutrient

The nutrient to extract from the nutrition object. Must be one of the nutrients in 'data(nutrients)', such as : "calories", "fat", "carbs", "fiber", "sugar", etc

Examples

1
2
3
4
5
6
7
## Not run: 

obj <- nutritionix_lookup("1 cheeseburger")
nutrition(obj, "calories")


## End(Not run)

tylerburleigh/nutritionR documentation built on Sept. 22, 2019, 7:21 p.m.