splusTimeSeries (version 1.5.0-75)

unionPositions: Positions Object Union With Tolerance

Description

Makes a union of numeric or calendar positions (that is, positions of series objects (which can be numeric), time vectors, or sequences) objects using localzone and matchtol as in the seriesMerge and align functions.

Usage

unionPositions(..., localzone = FALSE, matchtol = 0)

Arguments

the positions objects to be joined.

localzone

a logical value. If TRUE, creates a union by matching with all passed-in positions in their local time zones, instead of with the absolute GMT times. (The positions must be calendar-based.)

matchtol

the tolerance for matching positions. Positions that match within matchtol are not duplicated in the output.

Value

returns a new positions object containing all of the input positions, with duplicates (as defined by matchtol and localzone) removed.

returns numeric(0) if no ... arguments are given.

See Also

'>positions class, align, seriesMerge.

Examples

Run this code
# NOT RUN {
unionPositions(1:10, 5:20) 
unionPositions(1:10, 5.1:20.1, matchtol=.3) 
unionPositions(timeCalendar(d=1:10), timeCalendar(d=5:20)) 
unionPositions(timeCalendar(d=1:10, zone="PST"),  
               timeCalendar(d=5:20, zone="EST")) 
unionPositions(timeCalendar(d=1:10, zone="PST"),  
               timeCalendar(d=5:20, zone="EST"), localzone=TRUE) 
# }

Run the code above in your browser using DataCamp Workspace