recdate | R Documentation |
Rectify a date that may be out of wack.
recdate(jd=0, hr=0, mi=0, sec=0, yr=0)
recdatel(X)
jd |
Julian Day |
hr |
hours |
mi |
minutes |
sec |
seconds |
yr |
year |
or
X |
list of date |
Returns date with correct numbers. So if number of seconds is greater than 60, will add to minutes...
jd |
Julian Day |
hr |
hours |
mi |
minutes |
sec |
seconds |
yr |
year |
Default value for jd is 1, the rest are 0. This function now should successfully span year breaks. Leap years are correctly accounted for too.
Jonathan M. Lees<jonathan.lees.edu>
showdatetime, DAYSperYEAR, fromjul,getjul, tojul, getmoday
recdate(76, 23, 22, yr=2000)
########### example spanning leap year
## start on Day 1, but subtract 36 hours and proceed to plus 36 hours
hrs <- seq(from=-36, to=36, by=2)
rd <- recdate(jd=1, hr=hrs, mi=34,
sec=23+runif(n=length(hrs), 0, 59) , yr=2009)
write.table(data.frame(rd))
########### example spanning non-leap year
rd2 <- recdate(jd=1, hr=hrs, mi=34,
sec=23+runif(n=length(hrs), 0, 59) , yr=2008)
write.table(data.frame(rd2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.