Movatterモバイル変換


[0]ホーム

URL:


era

Project Status: Active – The project has reached a stable, usable state and is being actively developed.CRAN statusCRAN checksR-CMD-checkTest coverage

era is an R package that provides a consistentrepresentation of year-based time scales as a numeric vector with anassociatedera – theyr class.

It includes built-inera definitions formany year numbering systems used in contemporary and historic calendars(e.g. Common Era, Islamic ‘Hijri’ years); year-based time scales used inarchaeology, astronomy, geology, and other palaeosciences (e.g. BeforePresent, SI-prefixedannus); and support forarbitrary user-definederas. Years can converted from any one era to another using thegeneralised transformation functionyr_transform().

era’s classes are based onvctrs, and come with methods forrobust casting and coercion between years and other numeric types,type-stable arithmetic with years, and pretty-printing in tables.

Installation

You can install the released version of erafrom CRAN with:

install.packages("era")

Or the development version fromGitHub using theremotes package:

# install.packages("remotes")remotes::install_github("joeroe/era")

Basic usage

yr() defines the era associated with a vector ofyears:

library(era)x<-yr(c(9000,8000,7000),"cal BP")x#> # cal BP years <yr[3]>:#> [1] 9000 8000 7000#> # Era: Before Present (cal BP): Gregorian years (365.2425 days), counted backwards from 1950

Useyr_transform() to convert between eras:

yr_transform(x,"BCE")#> # BCE years <yr[3]>:#> [1] 7051 6051 5051#> # Era: Before Common Era (BCE): Gregorian years (365.2425 days), counted backwards from 1

Many common calendar systems and time scales are predefined (see?eras()) and can be referenced by their abbreviated labels.Other eras can be defined using theera() functiondirectly.

For further usage, see thepackage introduction(vignette("era")).


[8]ページ先頭

©2009-2025 Movatter.jp