dtt_aggregate {dttr2}R Documentation

Aggregates

Description

Aggregates a date/time vector

Usage

dtt_aggregate(x, units, ...)

## S3 method for class 'Date'
dtt_aggregate(x, units = "days", ...)

## S3 method for class 'POSIXct'
dtt_aggregate(x, units = "seconds", ...)

## S3 method for class 'hms'
dtt_aggregate(x, units = "seconds", ...)

Arguments

x

A date/time vector.

units

A string of the units to aggregate by.

...

Unused.

Details

The possible units values are 'seconds', 'minutes', 'hours', 'days', 'months' or 'years'.

Value

The floored date/time vector.

Methods (by class)

Examples

dtt_aggregate(as.Date(c("1992-01-01", "1991-02-02", "1991-03-03")), "years")

[Package dttr2 version 0.3.0 Index]