Learn R Programming

aion (version 1.4.0)

convert: Calendar Converter

Description

Interconverts dates in a variety of calendars.

Usage

convert(from, to, ...)

# S4 method for character,character convert(from, to)

# S4 method for TimeScale,TimeScale convert(from, to)

Value

A function that when called with a single numeric argument (factional years) converts years from one calendar to another.

Arguments

from

A TimeScale object describing the source calendar.

to

A TimeScale object describing the target calendar.

...

Currently not used.

Author

N. Frerebeau

See Also

Other calendar tools: calendar(), calendar_get, get_calendar(), gregorian, is_calendar(), julian()

Examples

Run this code
## Define time scales
BP <- calendar("BP")
AD <- calendar("AD")

## Make conversion functions
BP_to_AD <- convert(BP, AD)
AD_to_BP <- convert(AD, BP)

## Convert years
BP_to_AD(0)
AD_to_BP(1950)

Run the code above in your browser using DataLab