dtt_units {dttr2}R Documentation

Get Units

Description

Gets the smallest units for a date time vector. The possible values are 'seconds', 'minutes', 'hours', 'days', 'months' or 'years'.

Usage

dtt_units(x, ...)

## S3 method for class 'Date'
dtt_units(x, ...)

## S3 method for class 'POSIXct'
dtt_units(x, ...)

## S3 method for class 'hms'
dtt_units(x, ...)

Arguments

x

A Date, POSIXct or hms vector.

...

Unused.

Value

A string indicating the date time units.

Methods (by class)

Examples

dtt_units(as.Date("2000-01-01"))
dtt_units(as.Date("2000-02-01"))
dtt_units(as.Date("2000-01-02"))

[Package dttr2 version 0.3.0 Index]