This function measures the body fat based on the height and the weight of a person.
\[BMI = Weight/Size^2\]
library(McDonald)
x <- 180 #size in centimeters
y <- 75 #weight in kilos
bmi <- McDonald::bmi(x,y)
bmi %>% kableExtra::kable(col.names = "BMI", align = "l")
| BMI |
|---|
| 23.14815 |
The function calculates the amount of energy expended per day in a neutral environment.
\[BMR = Weight*Coefficient*24*LeanFactor\]
y <- 75 #weight in kilos
coefficient <- 1 #coefficient corresponding to the gender (1 for male and 0.9 for female)
d <- 24 #fix value
leanfactor <- 0.9 #lean factor that correspond to the gender and its respective BMI (see table), here 0.9
bmr <- McDonald::bmr(y, coefficient, d, leanfactor)
bmr %>% kableExtra::kable(col.names = "BMR", align = "l")
| BMR |
|---|
| 1620 |
This function computes the daily calorie need according to the BMR and the weekly physical activity.
\[Calories=BMR*multiplier\]
Physical activity (multiplier):
multiplier <- 1.65 #depends on your weekly phisical activites, here moderate activity = 1.65
needs <- McDonald::needs(bmr, multiplier)
needs %>% kableExtra::kable(col.names = "Daily calorie need", align = "l")
| Daily calorie need |
|---|
| 2673 |
Walking time in minutes needed to burn off the calories absorbed.
\[Walking=Kcal/((MET*3.5*Weight)/200)\]
y <- 75
MET <- 3 #normal walking = 3, fast walking = 4.5
e <- 3.5
f <- 200
kcal <- 850 #calories absorbed
walking_time <- McDonald::walking_time(y, MET, e, f, kcal) %>% round(digits = 0)
walking_time %>% kableExtra::kable(col.names = "Walking time in minutes at a normal pace", align = "l")
| Walking time in minutes at a normal pace |
|---|
| 216 |
McDonald::run()