convert: Calendar Converter

convertR Documentation

Calendar Converter

Description

Interconverts dates in a variety of calendars.

Usage

convert(from, to, ...)

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

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

Arguments

from

A TimeScale object describing the source calendar.

to

A TimeScale object describing the target calendar.

...

Currently not used.

Value

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

Author(s)

N. Frerebeau

See Also

Other calendar tools: calendar(), calendar_get, gregorian, is(), julian()

Examples

## 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)

aion documentation built on Oct. 4, 2024, 5:07 p.m.