R/aggregate.R

Defines functions dtt_aggregate

Documented in dtt_aggregate

#' Aggregate 
#'
#' @param x A Date or POSIXct vector.
#' @param units A string of the units to aggregate by.
#'
#' @return The floored, unique Date or POSIXct vector.
#' @export
#'
#' @examples
#' dtt_aggregate(dates)
dtt_aggregate <- function(x, units = dtt_units(x)) {
  check_dtt(x)
  x <- dtt_floor(x, units = units)
  x <- unique(x)
  x
}
poissonconsulting/dttr documentation built on Feb. 20, 2021, 12:18 a.m.