get_nutrientsource: get_nutrientsource

Description Usage Arguments Value Examples

View source: R/endpoints.R

Description

Makes a query to the Canadian Nutrient File nutrientsource endpoint. This endpoint returns a list of nutrient source id's and their corresponding description.

Usage

1
get_nutrientsource(apiKey = NULL, nutrientSourceId = 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_nutrientamount. If none is provided, the system environment variables will be checked.

nutrientSourceId

The code indicating the nutrient source you want to search for. If null, all nutrient sources are returned.

lang

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

Value

A tibble containing the id's of nutrient sources as well as their corresponding description.

Examples

1
2
3
4
5
## Not run: 
get_nutrientsource()
get_nutrientsource(nutrientSourceId = 108)
get_nutrientsource(nutrientSourceId = 108, lang = "fr")
## End(Not run)

jufil19/nutrientr documentation built on Feb. 22, 2022, 9:40 p.m.