Last data update: 2014.03.03

R: Join Functions for Irregular Time-Series Objects
itsJoinR Documentation

Join Functions for Irregular Time-Series Objects

Description

Join functions for objects of class "its".

Usage

alignedIts(obj1,obj2,print=FALSE)
appendIts(obj1,obj2,but=TRUE,matchnames=TRUE)
collapseIts(x)

Arguments

x

an object of class "its" or NULL

obj1,obj2

object of class "its"

print

logical flag to display summary information

but

logical flag controls whether overlap is disallowed

matchnames

logical flag controls whether names must match

Details

alignedIts selects the rows from two inputs which have identical time-stamps.

appendIts appends one object to the other, removing overlapping data from the later object, optionally checking that the column names match. Overlapping data must match.

collapseIts checks for columns with the same names, using dimnames(x)[[2]]. columns with the same names are required to have the same numeric values in each row, but are allowed NAs. The numeric data is combined, and the resulting object has unique column names - this will in general result in a reduction in the number of columns.

Value

For appendIts an object of class "its".

For alignedIts, a list of two objects of class "its"

Author(s)

Giles Heywood

See Also

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

Examples

its.format("%Y-%m-%d")
b <- newIts(1:30,ncol=3,start="2003-01-01",end="2003-01-10")
union(b,diff(b))
intersect(b,diff(b))
alignedIts(b,diff(b))
b1 <- newIts(1:30,ncol=3,start="2003-01-11",end="2003-01-20")
appendIts(b,b1)
c <- union(b,b*NA)
c[2,4] <- 99
c[2,1] <- NA
print(c)
collapseIts(c)

Results