In this vignette we will run through some calorie (kcal) related calculations. In the end you will know your basal metabolic rate and your total daily energy expenditure.
knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
First we load the befitteR
package and some additional packages.
library(befitteR) library(dplyr) # for left_join
Next, we set the body measures for a fictional person.
weight <- 80 # kg height <- 180 # cm age <- 30 # years sex <- "male" bfp <- 15 # percent objective <- 1 # the objective is to not lose or gain weight effort <- 1.375 # Moderately Active, Physical Work, Exercise, # or Sports 4 to 5 Days a Week, Construction Laborer
First we calculate the RMR. Here, we use the revised Harris-Benedict equation as an example.
calculate_rmr( weight = weight, height = height, age = age, sex = sex, bfp = bfp, equation = "revised-harris-benedict" )
The RMR should be slightly higher than the BMR, because it also takes into account that you need energy for things like breathing and digestion.
Let's go back to the BMR. We might want to know what the BMR is using the mean of all possible equations. You can find these equations using ?calculate_rmr
.
To calculate the BMR using all equations we use calculate_mean_rmr()
, which writes them to a dataframe, combined with the mean.
( mean_rmr <- calculate_mean_rmr( weight = weight, height = height, age = age, sex = sex, bfp = bfp ) )
We can then use the mean BMR (found in row 7, column 2 of our mean_rmr
tibble) to calculate the Total Daily Energy Expenditure. This will give you your mean TDEE.
# Use the mean calculate_tdee( rmr = mean_rmr[[7,2]], objective = 1, effort = 1.55 )
But... What if you would like to know your TDEE for all possible BMR equations? We can just use calculate_mean_tdee()
for that.
(mean_tdee <- calculate_mean_tdee(weight, height, age, sex, bfp, objective, effort))
Let's combine the BMR and TDEE dataframes so we have an overview. We join on the columns named Equation
.
(cals <- left_join(mean_rmr, mean_tdee, by = "Equation"))
# Take the mean out of the mean_tdee table. Which is row 7, column 2. calculate_water_intake(tdee = mean_tdee[[7,2]])
Let's convert our tdee to carb, protein and fat in grams in our specified balance.
calculate_macros(mean_tdee[[7,2]], balance = c(c = 0.5, p = 0.25, f = 0.25))
So this is what you would eat in a balance of 50% carbs, 25% protein and 25% fat.
For a keto diet, this would change to something else
keto <- c(c = 0.05, p = 0.25, f = 0.7) calculate_macros(mean_tdee[[7,2]], balance = keto)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.