View source: R/sidfex.ydoy2reltime.R
sidfex.ydoy2reltime | R Documentation |
Convert Year and DayOfYear to days since a reference time based on the Gregorian calendar
sidfex.ydoy2reltime(Year, DayOfYear, RefYear = 2017, RefDayOfYear = 1.0)
Year |
an integer scalar or vector specifying the year. Can also be character which will be coerced with |
DayOfYear |
a numeric scalar or vector specifying the day of the year. Can also be character which will be coerced with |
RefYear |
an integer scalar specifying the reference year. Can also be character which will be coerced with |
RefDayOfYear |
a numeric scalar specifying the reference day of year. Can also be character which will be coerced with |
a numeric vector of the same length as DayOfYear
.
If Year
has length 1 and DayOfYear
has length >1, the same Year
will be used for all values.
The convention for the day of the year is that January 1st begins with DayOfYear=1.0
, that is, DayOfYear=1.5
corresponds to January 1st 12:00.
Helge Goessling
y = c(2015,2015,2015,2016,2016,2016,2017,2017,2017)
doy = rep(c(1,180,365),3)
DaysSinceRef = sidfex.ydoy2reltime(Year=y,DayOfYear=doy,RefYear=2016,RefDayOfYear=1)
print(DaysSinceRef)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.