knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) Sys.setlocale("LC_CTYPE", "Japanese")
jlublidate provides wrappers of ymd() series from lubridate package to parse Japanese gengo (元号) (or nengo (年号)).
You can install jlubridate from GitHub with:
# install.packages("devtools") devtools::install_github("fmsan51/jlubridate")
jymd(): recognize date written in 元号 and convert it to POSIXct class object in 西暦.
library(jlubridate) jymd("昭和元年十二月二十五日", "平10.3.28", "R 4-3-1", "二〇一九年八月七日") # 元号 dates can be mixed with 西暦 dates.
元号 of 明治, 大正, 昭和, 平成, and 令和 can be recognized.
Formats which can be recognized are follows: 令和, 令, R, r, Reiwa, reiwa, REIWA.
jymd(), jymd_h(), jymd_hm(), and jymd_hms() correspond to ymd(), ymd_h(), ymd_hm() and ymd_hms() respectively.
gengo2seireki(): convert 元号 dates to 西暦 dates.
gengo2seireki("明治一二年三月四日")
kansuji2roman(): convert numbers written in Chinese characters (漢数字) to Roman numbers. Applicable only for integers from 0 to 9999.
kansuji2roman("千二百三十四")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.