Learn R Programming

CFtime (version 1.3.0)

+,CFtime,CFtime-method: 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 CFtime,CFtime
+(e1, e2)

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.

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.

Examples

Run this code
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

Run the code above in your browser using DataLab