Description Usage Arguments Value Examples
Makes a query to the Canadian Nutrient File nutrientamount endpoint. This endpoint returns a list of nutrient id's and details about their corresponding nutrient amounts, standard error of observation of nutrient amount and their names. For instance, for nutrient id 5, the name of the nutrient measured is caffeine and its nutrient value is 0.
1 | get_nutrientamount(apiKey = NULL, foodCode = 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_nutrientamount. If none is provided, the system environment variables will be checked. |
foodCode |
The code indicating the food you want to search for. If null, all foods and their corresponding nutrient amount are returned. |
lang |
The language to return results in, can be either 'en' or 'fr'. |
A tibble containing the foodCode, nutrient_value, number_observation, nutrientNameId, nutrient_web_name, nutrient_source_id
1 2 3 4 5 6 | ## Not run:
get_nutrientamount()
get_nutrientamount(foodCode = 4)
get_nutrientamount(foodCode = 4, lang = "fr")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.