Calculates how much of the energy content comes from carbohydrates.
carbPct(fat, carbs, protein, fiber = 0, kcal = 0)
grams of fat per unit of measurement (e.g. 100 g)
grams of carbohydrates per unit of measurement (e.g. 100 g)
grams of protein per unit of measurement (e.g. 100 g)
grams of fiber per unit of measurement (e.g. 100 g)
total energy per unit of measurement (e.g. 100 g)
percentage of energy from carbs
carbPct(57, 11, 19, 8)
#> Total energy: 641 kcal
#> [1] 0.06864275