#' @title Check if sex is either male or female
#'
#' @description
#' \lifecycle{stable}
#'
#' Utility function for checking if the provided sex is either
#' male of female. Setting the right sex is in a lot of cases required and will
#' influence calculations. This function is only for internal use.
#'
#' @param sex sex; either male or female
#'
#' @return sex as non-capitalized verb
#'
#' @examples
#' check_sex("male")
#' check_sex("female")
#' @rdname check_sex
#' @importFrom checkmate assert_choice
#' @keywords internal
#' @noRd
check_sex <- function(sex) {
choices <- c("male", "female")
checkmate::assert_choice(sex, choices)
return(sex)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.