conv.ref.date: Compute dayno from a written date like March 22, 2018

Description Usage Arguments Value Author(s)

View source: R/English-months-function.R

Description

Compute the number of days (i.e. the dayno) between a date in the format "March 22, 2018" to some reference (the zero date) such as 01.01.2014. The function has been developed to validate dates related to the cobaly-60 irradiations.

Note that the match to English spelling of months only uses the first three letters. Sample call:

conv.ref.date("March 22, 2018, 12:00")

conv.ref.date(c("March 22, 2018", "March 21, 2018", "March 22, 2019"),c("12:00"), zero.time="00:00",zero.date="22.03.2018")

with this output:

dstr.org d m y dstr dayno

March 22, 2018 22 3 2018 22.03.2018 0.5

March 21, 2018 21 3 2018 21.03.2018 -0.5

March 22, 2019 22 3 2019 22.03.2019 365.5

Note that this requires chron:

install.packages("chron")

require(chron)

See also: dayno.calc dayno.clock.reversed dayno.clock English.months get.date.range

Usage

1
conv.ref.date("March 22, 2018, 12:00")

Arguments

ref.date.vec

vector with dates in the format "March 22, 2018".

ref.time.vec

vector (or just a single value) with times in the format "12:00".

zero.date

in the format "01.01.2014".

zero.time

in the format "12:00".

Value

dateframe with detailed info (see example)

Author(s)

Claus E. Andersen


claus-e-andersen/clanTools documentation built on Oct. 23, 2020, 7:59 a.m.