R/next_fy.r

Defines functions prev_fy next_fy

next_fy <- function(fy = NULL, h = 1L) {
  if (is.null(fy)) {
    return(yr2fy(year(Sys.Date()) + h))
  }
  yr2fy(as.integer(substr(fy, 0L, 4L)) + 1L + h)
}

prev_fy <- function(fy = NULL, h = 1L) {
  next_fy(fy, h = -h)
}

Try the grattan package in your browser

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

grattan documentation built on June 22, 2024, 11:55 a.m.