Last active
October 7, 2018 14:13
-
-
Save damianooldoni/169af1d9f1699896c47b865389a46a58 to your computer and use it in GitHub Desktop.
Function to calculate the theoretical maximum Heart Rate (HRmax)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Function to caclulate the theoretical maximum Heart Rate (HRmax) | |
#' | |
#' @param sex (character) "M" or "F" | |
#' @param age (numeric) Age in years | |
#' @param weight (numeric) Weight in kilograms | |
#' | |
#' @return theoretical maximum Heart Rate | |
#' @examples | |
#' get_HRmax(sex = "M", age = 35, weight = 61) | |
#' | |
get_HRmax <- function(sex, age, weight) { | |
HRmax <- 210 | |
if (sex == "M") { | |
HRmax <- HRmax + 4 | |
} | |
HRmax <- HRmax - weight/11 - age/2 | |
return(HRmax) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment