View source: R/English-months-function.R
conv.ref.date | R Documentation |
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
conv.ref.date("March 22, 2018, 12:00")
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". |
dateframe with detailed info (see example)
Claus E. Andersen
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.