+,CFtime,CFtime-method {CFtime}R Documentation

Merge two CFtime objects

Description

Two CFtime instances can be merged into one with this operator, provided that the units and calendars of the datums of the two instances are equivalent.

Usage

## S4 method for signature 'CFtime,CFtime'
e1 + e2

Arguments

e1, e2

CFtime. Instances of the CFtime class.

Details

If the origins of the two datums are not identical, the earlier origin is preserved and the offsets of the later origin are updated in the resulting CFtime instance.

The order of the two parameters is indirectly significant. The resulting CFtime instance will have the offsets of both instances in the order that they are specified. There is no reordering or removal of duplicates. This is because the time series are usually associated with a data set and the correspondence between the data in the files and the CFtime instance is thus preserved. When merging the data sets described by this time series, the order must be identical to the merging here.

Any bounds that were set will be removed. Use bounds() to retrieve the bounds of the individual CFtime instances and then set them again after merging the two instances.

Value

A CFtime object with a set of offsets composed of the offsets of the instances of CFtime that the operator operates on. If the datum units or calendars of the CFtime instances are not equivalent, an error is thrown.

Examples

e1 <- CFtime("days since 1850-01-01", "gregorian", 0:364)
e2 <- CFtime("days since 1850-01-01 00:00:00", "standard", 365:729)
e1 + e2

[Package CFtime version 1.4.0 Index]