R/list_of_months.R

Defines functions list_of_months

Documented in list_of_months

#' Create list of months based on end month and number of months back
#'
#'
#' @param end character variable
#' @param months_back numeric variable
#'
#' @return list
#'
#' @examples
#' list_of_months(end = "2017-07-01", months_back = 3)
#'
#' @importFrom rlang .data
#' @export
list_of_months <- function(end = "2021-02-01", months_back = 23) {
  usethis::ui_warn("Replace this function with make_timeseries!!")
  to <- as.Date(end)
  from <- to - lubridate::period(months_back, "month")
  seq.Date(from = from, to = to, by = "month")
}
mvbloois/faiR documentation built on Dec. 21, 2021, 11:04 p.m.