itsSubset: Range and Extract for Irregular Time-Series Objects

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Range and extract for objects of class "its".

Usage

1
2
rangeIts(x,start=dates(x)[1],end=dates(x)[nrow(x)],format=its.format(),...)
extractIts(x,weekday=FALSE,find=c("all","last","first"),period=c("week","month","year"),partials=TRUE,firstlast = FALSE,select)

Arguments

x

an object of class "its"

start, end

POSIXct or character representation of the start or end time-stamp, if character, then the format is as specified by the argument format

format

format of "start" and "end" dates, see format.POSIXct.

dates

POSIX dates specifying the timestamps of rows to be extracted from the irregular time-series object

...

further arguments passed to as.POSIXct

weekday

logical, defines whether only weekdays are to be returned

find

to find the first, last, or all samples within each period

period

the period within which 'find' and/or 'select' operate

partials

defines whether the first (possibly incomplete) period is processed for find=first, and whether the last is processed for find=last

firstlast

if TRUE, the first and last observations are returned, in addition to those observations selected by other criteria

select

an integer vector defining one or more days to select. The integer specifies wday (for period=week) or mday (for period=month). See as.POSIXlt for details

Details

rangeIts selects a range of rows that fall between two times, specified in text format.

extractIts selects a subset of rows that obey some sort of semi-regular rule such as monthends, weekdays, and so on. The order of application is weekday, find, then select.

Value

An object of class "its".

Author(s)

Giles Heywood

See Also

ts, POSIXct, itsFile, itsLags, itsJoin, itsTimes, itsSubset, itsFin, itsInterp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
its.format("%Y-%m-%d")
b <- newIts(start="2003-01-01",end="2003-01-20")
rangeIts(b,start = "2003-01-05" ,end= "2003-01-15")
rangeIts(b,start = ISOdate(2003,1,5,hour=0) ,end= ISOdate(2003,1,15,hour=0))
b[1:3,]
b[,1]
b[,dates=ISOdate(2003,1,1,hour=0,tz="")]
its.format("%a %d %b %Y")
c <- newIts()
extractIts(c,weekday=TRUE,period="month",find="last")  #the last weekdays of the month in c

armstrtw/its documentation built on May 10, 2019, 1:42 p.m.