Learn R Programming

nutrition (version 1.1.0)

fiberGrams: Calculate the amount of fiber in food

Description

Sometimes, nutritional labels fail to inform the amount of fiber it contains. This function helps one estimate this given other parameters.

Usage

fiberGrams(kcal, fat, carbs, protein)

Value

Grams of fiber per unit of measurement

Arguments

kcal

total energy per unit of measurement (e.g. 100 g)

fat

grams of fat per unit of measurement (e.g. 100 g)

carbs

grams of carbohydrate per unit of measurement (e.g. 100 g)

protein

grams of protein per unit of measurement (e.g. 100 g)

Author

Waldir Leoncio

Examples

Run this code
fiberGrams(362, 17, 11, 40)

Run the code above in your browser using DataLab