R/getc.R

Defines functions getc

Documented in getc

#' Return the correct country name
#'
#' @param country country name to be checked
#' @return correct country name
#' @examples
#' getc("USA")
#' @export

getc <- function(country) {

  dict <- dict
  sel <- which(dict$wrong == country)
  if (length(sel) != 1) {
    if (length(sel) == 0) message(paste(country, "not found"))
    if (length(sel)  > 1) message(paste(country, "found multiple times"))
    return(NA)
  } else return(dict$right[sel])
}
elenakhusainova/EPI_Rpackage documentation built on April 17, 2020, 9:48 a.m.