Learn R Programming

nutrition (version 1.1.0)

carbPct: Percentage of carbs in food

Description

Calculates how much of the energy content comes from carbohydrates.

Usage

carbPct(fat, carbs, protein, fiber = 0, kcal = 0)

Value

percentage of energy from carbs

Arguments

fat

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

carbs

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

protein

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

fiber

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

kcal

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

Author

Waldir Leoncio

Examples

Run this code
carbPct(57, 11, 19, 8)

Run the code above in your browser using DataLab