get_nutrientgroup: get_nutrientgroup

View source: R/endpoints.R

get_nutrientgroupR Documentation

get_nutrientgroup

Description

Makes a query to the Canadian Nutrient File refuseamount endpoint. This endpoint returns a list of all nutrient group ids and their names. For instance, if nutrient group id is mentioned as 5, the corressponding group name is amino acids

Usage

get_nutrientgroup(apiKey = NULL, nutrientGroupId = NULL, lang = "en")

Arguments

apiKey

Key to access the API. Can be retrieved from https://hc-sc.api.canada.ca/en/detail?api=cnf#!/Nutrient/get_nutrientgroup. If none is provided, the system environment variables will be checked.

nutrientGroupId

The code indicating the nutrient group you want to search for. If null, all foods and their corresponding names are returned.

lang

The language to return results in, can be either 'en' or 'fr'.

Value

A tibble containing nutrient group's id, name, order

Examples

## Not run: 
get_nutrientgroup()
get_nutrientgroup(nutrientGroupId = 7)
get_nutrientgroup(nutrientGroupId = 7, lang = "fr")
## End(Not run)

nutrientr documentation built on March 18, 2022, 6:27 p.m.