get_nutrient_info: Convert JSON data to a simpler data.frame object.

Description Usage Arguments Value See Also Examples

View source: R/data_manipulators.R

Description

When JSON data is requested, 'get_nutrient info' provides a convenient way to get semi-clean data.

Usage

1
get_nutrient_info(res, abbr = TRUE, abbr_limit = 14)

Arguments

res

An object of type 'json' obtained from 'get_nutrients'

abbr

Logical. Should the names of Source be abbrevaited? Defaults to TRUE.

abbr_limit

If abbr is TRUE, this determines the abbreviation limit. Defaults to 14.

Value

The default return value is a data.frame object showing the corresponding data as requested with 'get_nutrients'. If bind_data is set to FALSE, a list of data frames is returned instead.

See Also

get_nutrients

Examples

1
2
3
4
5
## Not run: 
res<-get_nutrients(nutrients = "204")
head(get_nutrient_info(res))

## End(Not run)

Nelson-Gon/usdandbr documentation built on Jan. 22, 2020, 4:07 a.m.