R package for years with an era
era 





era is an R package that provides a consistent vector representationof years with an associated calendar era or time scale. It includesbuilt-in definitions of many contemporary and historic calendars; timescales commonly used in archaeology, astronomy, geology, and otherpalaeosciences (e.g. Before Present, SI-prefixed annus); and supportfor arbitrary user-defined eras. Functions for converting between erasand for type-stable arithmetic with years are also provided.
Installation
You can install the released version of era fromCRAN with:
rinstall.packages("era")
Or the development version from GitHub with:
``` r
install.packages("devtools")
devtools::install_github("joeroe/era")```
Basic usage
yr()
defines the era associated with a vector of years:
``` rlibrary(era)x <- yr(c(9000, 8000, 7000), "cal BP")x
> # cal BP years
> [1] 9000 8000 7000
> # Era: Before Present (cal BP): Gregorian years (365.2425 days), counted backwards from 1950
```
Use yr_transform()
to convert between eras:
``` ryr_transform(x, "BCE")
> # BCE years
> [1] 7050 6050 5050
> # Era: Before Common Era (BCE): Gregorian years (365.2425 days), counted backwards from 0
```
Many common calendar systems and time scales are predefined (see?eras()
) and can be referenced by their abbreviated labels. Other erascan be defined using the era()
function directly.
For further usage, see the packageintroduction(vignette("era")
).
To restore the repository download the bundle
wget https://archive.org/download/github.com-joeroe-era_-_2021-02-02_13-48-22/joeroe-era_-_2021-02-02_13-48-22.bundle
and run:
git clone joeroe-era_-_2021-02-02_13-48-22.bundle
Source:
https://github.com/joeroe/eraUploader:
joeroeUpload date: 2021-02-02