R/attach_t.R

Defines functions attach_t

Documented in attach_t

#' @title Attach internal time index column
#'
#' @param df Data frame. Must have column `date`.
#' @keywords internal
#' @return Tibble.
attach_t <- function(df) {
  (df
   |> dplyr::mutate(t = as.integer(date - min(date, na.rm = TRUE)+1)))
}

Try the ern package in your browser

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

ern documentation built on April 4, 2025, 2:13 a.m.