as.difftime: Difftime with units Months and Years

as.difftimeR Documentation

Difftime with units Months and Years

Description

Expand difftime units to include months and years .

Usage

as.difftime(tim, format = "%X", units = "auto")

Arguments

tim

See base as.difftime. Must be numeric when units is "months" or "years".

format

See base as.difftime.

units

Anything allowed by base::as.difftime. In addition, can be "months" or "years" in which case tim must be numeric.

Details

Primarily used to facilitate adding months and years to mondates. See base as.difftime.

Value

See base as.difftime.

Author(s)

Dan Murphy.

See Also

Base as.difftime

Examples

x <- mondate(0:12)
y <- as.difftime(1, , "months")
x + y
x - y

chiefmurph/mondate documentation built on Aug. 29, 2022, 4:13 p.m.