R/code2hem.R

Defines functions code2hem

Documented in code2hem

#' Code to HEM name
#'
#' \code{code2hem} returns the name of the HEM corresponding to the code of the T2080 manual.
#' When gathering experimental data the captured HEMs will be coded with a number.
#' This functions transforms the number into the reference name in the T2080 manual.
#' @param cod HEM code on the T2080 manual.
#' @return Returns the name of the HEM that corresponds to the input code.
#' @keywords HEM
#' @export
#' @examples
#' code <- 1
#' hem <- code2hem(code)
#' hem
#'
code2hem <- function(cod = NULL) {
  pmcs_n_codes <- mergingTools::T2080_code2name$hems
  names(pmcs_n_codes) <- mergingTools::T2080_code2name$code
  hem <- pmcs_n_codes[cod]
  return(hem)
}

Try the mergingTools package in your browser

Any scripts or data that you put into this service are public.

mergingTools documentation built on Sept. 14, 2023, 1:06 a.m.