datestr_to_ymd: transform string to ymd data table.

View source: R/calendar.R

datestr_to_ymdR Documentation

transform string to ymd data table.

Description

transform string to ymd data table like data.frame(y=2022,m=5,d=12) or pair of such data.frame. NA will be filled for uncertain elements.

Usage

datestr_to_ymd(
  datestr,
  Date.beg = NULL,
  Date.end = NULL,
  strict = TRUE,
  use.range = TRUE,
  use.jpera = TRUE,
  use.exceldate = FALSE,
  exceldate.origin = as.Date("1904-01-01")
)

Arguments

datestr

target character or sequence of character.

Date.beg

potentially start date; used for validation and estimation.

Date.end

potentially end date; used for validation and estimation.

strict

return NA if read datestr is out of Date.beg-Date.end range

use.range

Allow range date format

use.jpera

Allow Japanese era case (e.g., R2.4.5 or 令和3年4月11日).

use.exceldate

Allow to check the value which is originally excel date but occationally transformed to normal value.

exceldate.origin

Origin of excel date. In default, it is 1900-01-01 if the file is originally created on Windows and 1904-01-01 on Mac.

Value

transformed data.frame


hmito/hmRLib documentation built on March 13, 2024, 9:41 p.m.