R/find_wet_season_end.R

Defines functions find_wet_season_end

Documented in find_wet_season_end

#' Find Wet Season End Date
#'
#' @param wet_season_start A vector of dates signifying the first day
#' of the wet season for site year combinations.
#' @param wet_season_length The length of the wet season in days.
#'
#' @return A character vector
#' @export
#'
#' @examples
#' wet_season_start_dates <- as.Date(c("2014-10-04", "2014-12-30", "2015-09-12"))
#' wet_season_end_dates <- find_wet_season_end(wet_season_start_dates)
#' #cut of date for the sampling year will be last day of June
find_wet_season_end <- function(wet_season_start, wet_season_length = 182) {
  end <- (as.POSIXct(wet_season_start, format = "%Y-%m-%d") + wet_season_length*86400)
  return(end)
}

Try the CalcThemAll.PRM package in your browser

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

CalcThemAll.PRM documentation built on May 29, 2024, 5:39 a.m.