#' @title Calculate muscle mass
#'
#' @description
#' \lifecycle{stable}
#'
#' Calculate muscle mass in kg.
#'
#' @param height height in cm.
#' @param sex `male` or `female`.
#' @param fg forearm girth in cm.
#' @param cg calf girth in cm.
#' @param c_skinfold calf skinfold.
#' @param tg thigh girth in cm.
#' @param t_skinfold thigh skinfold.
#'
#' @details Martin, A.D., Spenst, L.F., Drinkwater, D.T. and Clarys, J.P.
#' (1990) Anthropometric estimation of muscle mass in men. Medicine and Science
#' in Sports and Exercise, 22, 729-733.
#' The calculation is based on the following equation:
#' (equation)
#'
#' @examples
#' calculate_muscle_mass(
#' 180,
#' sex = "male",
#' fg = 24,
#' cg = 34,
#' c_skinfold = 100,
#' tg = 55,
#' t_skinfold = 100
#' )
#' @rdname calculate_muscle_mass
#' @export
calculate_muscle_mass <-
function(height,
sex = "male",
fg,
cg,
c_skinfold,
tg,
t_skinfold) {
# topendsports.com/testing/tests/muscle-mass-calculation.htm
check_sex(sex)
if (sex == "male") {
ccg <- cg - pi * (c_skinfold / 10)
ctg <- tg - pi * (t_skinfold / 10)
muscleMass <-
height * (0.0553 * ctg^2 + 0.0987 * fg^2 + 0.0331 * ccg^2) - 2245
} else {
stop("This equation only works for males")
}
return(muscleMass / 1000)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.