From 1246652e568e2495230d21071f979dd6888de1ef Mon Sep 17 00:00:00 2001 From: Joe Thorley Date: Mon, 8 Jul 2024 11:28:42 -0700 Subject: [PATCH] drop msgs argument to date_atus() --- R/atu-index.R | 3 +-- R/date-atus.R | 6 ++---- man/date_atus.Rd | 4 +--- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/R/atu-index.R b/R/atu-index.R index 42b204f..e4f8523 100644 --- a/R/atu-index.R +++ b/R/atu-index.R @@ -1,8 +1,7 @@ .atu_index <- function( x, date, - atus, - msgs = TRUE) { + atus) { x <- pmax(x, 0) x <- cumsum(x) diff --git a/R/date-atus.R b/R/date-atus.R index f7455cd..ee27fb6 100644 --- a/R/date-atus.R +++ b/R/date-atus.R @@ -12,8 +12,7 @@ date_atus <- function( x, atus = 600, - start_date = as.Date("1972-03-01"), - msgs = TRUE) { + start_date = as.Date("1972-03-01")) { check_data(x, list(date = dttr2::dtt_date("1970-01-01"), temperature = c(1, NA))) chk_date(start_date) @@ -51,8 +50,7 @@ date_atus <- function( dplyr::group_modify(~.atu_index( .x$temperature, .x$date, - atus = atus, - msgs = msgs), .keep = TRUE) |> + atus = atus), .keep = TRUE) |> dplyr::mutate(end_date = dttr2::dtt_dayte(end_date, start_date), start_date = start_dayte) |> dplyr::select(c("year", "start_date", "end_date", "atus")) diff --git a/man/date_atus.Rd b/man/date_atus.Rd index 1ab2c04..c49b51b 100644 --- a/man/date_atus.Rd +++ b/man/date_atus.Rd @@ -4,7 +4,7 @@ \alias{date_atus} \title{Calculate Date of Accumulated Thermal Units (ATUs)} \usage{ -date_atus(x, atus = 600, start_date = as.Date("1972-03-01"), msgs = TRUE) +date_atus(x, atus = 600, start_date = as.Date("1972-03-01")) } \arguments{ \item{x}{A data frame with two columns \code{date} and \code{temperature}. @@ -18,8 +18,6 @@ mean daily water temperature in degrees centigrade.} within each year to consider (the year is ignored). #' If \code{start_date} occurs before the \code{end_date} (when ignoring the year) then the window is considered to span two calendar years.} - -\item{msgs}{A flag specifying whether to provide messages.} } \value{ A tibble with four columns \code{year}, \code{start_date}, \code{end_date} and \code{atus}.