get_nutrient_id: Convenience function to easily extract nutrient ids.

Description Usage Arguments Value Examples

View source: R/get_nutrient_id.R

Description

Provides an easy way to access nutrient ids as provided by the USDA.

Usage

1
get_nutrient_id(nutrient_name, df)

Arguments

nutrient_name

Name of the nutrient for which an id is returned.

df

The data set that contains nutrient ids. Can be loaded into the environment by calling 'data("nutrient_ids")'. If no data set is provided, the default is to use 'nutrient_ids'.

Value

Returns the nutrient id.

Examples

1
2
data("nutrient_ids")
get_nutrient_id("myri",nutrient_ids)

Nelson-Gon/usdandbr documentation built on Jan. 22, 2020, 4:07 a.m.