View source: R/detector-dst-leap.R
detectdst | R Documentation |
Functions to detect, when Daylight Saving Time and leap year start and finish
detectdst(object)
detectleap(object)
object |
Either a zoo / xts object or a vector of dates / times in POSIXt / Date
class. Note that in order for |
The detectdst
function detects, when the change for the DST starts and ends. It
assumes that the frequency of data is not lower than hourly.
The detectleap
function does similar for the leap year, but flagging the 29th
of February as a starting and to the 28th of February next year as the ending dates.
In order for the methods to work, the object needs to be of either zoo / xts or POSIXt class and should contain valid dates.
List containing:
start - data frame with id (number of observation) and the respective dates, when the DST / leap year start;
end - data frame with id and dates, when DST / leap year end.
Ivan Svetunkov, ivan@svetunkov.com
xregExpander, temporaldummy,
outlierdummy
# Generate matrix with monthly dummies for a zoo object
x <- as.POSIXct("2004-01-01")+0:(365*24*8)*60*60
detectdst(x)
detectleap(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.