Learn R Programming

nutrientr (version 0.1)

get_all_nutrient_info: get_all_nutrient_info(foodCode)

Description

Makes queries to the Canadian Nutrient APIs to get all available nutrient information about a particular food.

Usage

get_all_nutrient_info(foodCode, apiKey = NULL, lang = "en")

Arguments

foodCode

The code indicating the food you want to search for.

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.

lang

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

Value

A tibble containing all available nutrient information about the food code.

Examples

Run this code
# NOT RUN {
get_all_nutrient_info(foodCode = 45)
# }

Run the code above in your browser using DataLab