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

fiberGrams(kcal, fat, carbs, protein)

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)

Value

Grams of fiber per unit of measurement

Author

Waldir Leoncio

Examples

fiberGrams(362, 17, 11, 40)
#> [1] 5