subsetFoodRichIn {NutrienTrackeR} | R Documentation |
Find nutrient-rich foods
Description
This function selects the foods with the highest amount of a given nutrient from a food composition database.
Usage
subsetFoodRichIn(nutrient_name, food_database = "USDA", food_group = NULL, n = 10)
Arguments
nutrient_name |
character vector indicating the name of the nutrient of interest. |
food_database |
character vector indicating the food database to be used. Possible values are: "USDA", "CIQUAL", "BEDCA", "STFCJ". |
food_group |
character vector indicating the food group(s) of interest. NULL indicates that all food groups are considered. |
n |
numeric value indicating the number of foods to be selected. |
Value
A subset from the food composition database containing the foods with the highest amount of the nutrient of interest.
Examples
## Load data
data(food_composition_data)
## Get foods rich in niacin
subsetFoodRichIn(nutrient_name = "Niacin (mg)", food_database = "USDA", n = 5)
subsetFoodRichIn(nutrient_name = "Niacin (mg)", food_database = "CIQUAL", n = 5)
subsetFoodRichIn(nutrient_name = "Niacin (mg)", food_database = "BEDCA", n = 5)
## Get foods rich in niacin from CIQUAL within the group "diary products and deserts"
subsetFoodRichIn(nutrient_name = "Niacin (mg)", food_database = "CIQUAL", n = 5,
food_group = "dairy products and deserts")
[Package NutrienTrackeR version 1.3.0 Index]