R/qr.to.month.R

Defines functions qr.to.month

#' Title
#'
#' qr.to.month transforms  a quarter to the respective month.
#'
#' @param quarter is a integer from 1 to 4
#'
#' @return a integer cointained in the vector {1, 4, 7, 10}
#' @export
#'
#' @examples

qr.to.month <- function(quarter) {
  if (quarter %in% c(1, 2, 3, 4)) {
    (3 * (quarter - 1)) + 1
  } else {
    message("Quarter expects a integer from 1 to 4")
  }
}
gabrielzanlorenssi/extfunctions documentation built on Dec. 30, 2019, 6:37 p.m.