get_refuseamount: get_refuseamount

Description Usage Arguments Value Examples

View source: R/endpoints.R

Description

Makes a query to the Canadian Nutrient File refuseamount endpoint. This endpoint returns a list of refuse amounts and name as well as the corresponding food code and description. Refuse amounts correspond to the inedible portion of the food. For instance, searching for food code 557 (Chicken, broiler, meat, skin, giblets and neck) will return a refuse amount of 28 and its associated name is 'bone'.

Usage

1
get_refuseamount(apiKey = NULL, foodCode = 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.

foodCode

The code indicating the food you want to search for. If null, all foods and their corresponding refuse amounts are returned.

lang

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

Value

A tibble containing refuse name, refuse amount, food names and food codes.

Examples

1
2
3
4
5
## Not run: 
get_refuseamount()
get_refuseamount(foodCode = 557)
get_refuseamount(foodCode = 557, lang = "fr")
## End(Not run)

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