Skip to contents

Convenience wrapper that returns a named list with values and se tibbles, both filtered identically.

Usage

get_nutrition_with_se(
  food = NULL,
  table = NULL,
  nutrients = NULL,
  match = c("fixed", "regex")
)

Arguments

food

Character string matched against food name (case-insensitive substring) or food code (exact). NULL returns all foods.

table

One of "proximate", "vitamins_water", "vitamins_fat", "carotenoids", "minerals", "sugars", "fatty_acids", "amino_acids", "organic_acids", "polyphenols", "oligosaccharides", "edible_oils". NULL joins all tables on food code and returns a wide result.

nutrients

Optional character vector of column name substrings to select (applied after table filter). NULL returns all columns.

match

One of "fixed" (default) or "regex".

Value

A list with two elements: values and se, each a tibble.

Examples

res <- get_nutrition_with_se("chickpea", table = "amino_acids")
#> Warning: No foods matching "chickpea" found in table "amino_acids".
#> Warning: No foods matching "chickpea" found in table "amino_acids".
res$values
#> # A tibble: 0 × 0
res$se
#> # A tibble: 0 × 0