Learn R Programming

mondate (version 1.0)

as.difftime: Difftime with units Months and Years

Description

Expand difftime units to include months and years .

Usage

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

Value

See as.difftime.

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.

Author

Dan Murphy.

Details

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

See Also

Examples

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

Run the code above in your browser using DataLab