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

character string or numeric value specifying a time interval.

format

character specifying the format of tim: see strptime. The default is a locale-specific time format.

units

Anything allowed by 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 as.difftime.

Value

See 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

mondate documentation built on May 29, 2024, 1:32 a.m.

Related to as.difftime in mondate...