yearJAD {lazy.tools} | R Documentation |
Conversion between Japanese Era and AD
yearJAD(yearJ = 1952, yearAD = NULL, EraName = "")
yearJ |
a vector of Japanese years with Japanese era name, e.g. M01, T15, S27, H1, R04 |
yearAD |
a vector of years in AD |
EraName |
a Japanese Era Name to be used for the conversion from AD |
yearJAD( "R1" )
returns 2019.
yearJAD( yearAD=2019 )
returns "R01".
yearJAD( yearAD=2019, EraName="S" )
returns "S94".
# 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