dtt_subtract_units {dttr2}R Documentation

Subtract Units

Description

Subtract time units from a date time vector.

Usage

dtt_subtract_units(x, n = 1L, units = dtt_units(x))

dtt_subtract_years(x, n = 1L)

dtt_subtract_months(x, n = 1L)

dtt_subtract_days(x, n = 1L)

dtt_subtract_hours(x, n = 1L)

dtt_subtract_minutes(x, n = 1L)

dtt_subtract_seconds(x, n = 1L)

Arguments

x

A date time vector.

n

An integer of the number of units.

units

A string of the units.

Value

The modified date time vector.

See Also

dtt_add_units()

Examples

dtt_subtract_units(as.Date("1999-12-31"), 2L, "days")

[Package dttr2 version 0.3.0 Index]