Description Usage Arguments Value Examples
Makes a query to the Canadian Nutrient File nutrientname endpoint. This endpoint returns a list of all nutrient names, symbols, names, unit of measurement, nutrient group name, etc. For instance, for nutrient name id of 810, the corresponding nutrient symbol is STAR and nutrient name is STARCH, unit is 2 and nutrient group id is 2.
1 | get_nutrientname(apiKey = NULL, nutrientNameId = NULL, lang = "en")
|
apiKey |
Key to access the API. Can be retrieved from https://hc-sc.api.canada.ca/en/detail?api=cnf#!/Nutrient/get_nutrientname. If none is provided, the system environment variables will be checked. |
nutrientNameId |
The code indicating the food name you want to search for. If null, all foods and their corresponding symbols and are returned. |
lang |
The language to return results in, can be either 'en' or 'fr'. |
A tibble containing nutrient name id, name, code, web_name and other details
1 2 3 4 5 | ## Not run:
get_nutrientname()
get_nutrientname(nutrientNameId = 550)
get_nutrientname(nutrientNameId = 550, lang = "fr")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.