extract_energy: Extract the energy content of a product from the nutrition...

View source: R/extract_energy.R

extract_energyR Documentation

Extract the energy content of a product from the nutrition table

Description

Helper function to extra the energy content (e.g., kcal or kJ) from the nutrition table of a product that was collected from the oc_collect_nutrition_table function.

Helper function to convert the energy content (e.g., kcal or kJ) extracted from extract_energy function into kcal unit.

Usage

extract_energy(data, item, nutrition)

extract_kcal(data)

Arguments

data

Output from extract_energy function

item

Product name column.

nutrition

Nutrition table column.

Value

A tibble with product name and energy content, if available.

A tibble with product name, energy content (if available) and energy content converted into kcal unit.

See Also

oc_collect_nutrition_table


moamiristat/grocerycart documentation built on June 15, 2022, 10 a.m.