yearJAD {lazy.tools}R Documentation

Conversion between Japanese Era and AD

Description

Conversion between Japanese Era and AD

Usage

yearJAD(yearJ = 1952, yearAD = NULL, EraName = "")

Arguments

yearJ

a vector of Japanese years with Japanese era name, e.g. M01, T15, S27, H1, R04

yearAD

a vector of years in AD
This has priority over yearJ.

EraName

a Japanese Era Name to be used for the conversion from AD

Details

yearJAD( "R1" ) returns 2019.
yearJAD( yearAD=2019 ) returns "R01".
yearJAD( yearAD=2019, EraName="S" ) returns "S94".

Examples

# conversion table
yJ <- c("M1","M2","M44","M45","T1","T2","T14","T15","S1","S2","S63","S64"
     , "H01","H02","H30","H31","R1","R2","R4")
yAD <- yearJAD( yJ )
yJfromAD <- yearJAD( yearAD=yAD )
Print(yJ,yAD,yJfromAD)

# using out-of-range Era Name
yearJAD(yearAD=2017, EraName="R")  # negative number
yearJAD(yearAD=2018, EraName="R")  # year 0 means a year before year 1.
yearJAD(yearAD=2019, EraName="R")

yearJAD(yearAD=1952, EraName="T")
yearJAD(yearAD=1952, EraName="S")
yearJAD(yearAD=1952, EraName="H")  # negative number


[Package lazy.tools version 0.1.6 ]