| Version: | 1.5.7 |
| Title: | Time Series from 'S-PLUS' |
| Depends: | R (≥ 2.10), splusTimeDate (≥ 2.5.2) |
| Imports: | graphics, methods, stats |
| Description: | A collection of classes and methods for working with indexed rectangular data. The index values can be calendar (timeSeries class) or numeric (signalSeries class). Methods are included for aggregation, alignment, merging, and summaries. The code was originally available in 'S-PLUS'. |
| License: | BSD_3_clause + file LICENSE |
| URL: | https://github.com/spkaluzny/splusTimeSeries |
| BugReports: | https://github.com/spkaluzny/splusTimeSeries/issues |
| LazyData: | no |
| NeedsCompilation: | yes |
| Packaged: | 2024-09-19 03:57:23 UTC; spk |
| Author: | Stephen Kaluzny [aut, cre], TIBCO Software Inc. [aut, cph] |
| Maintainer: | Stephen Kaluzny <spkaluzny@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2024-09-19 16:00:02 UTC |
Time Series and Signal Aggregation
Description
Aggregation and coursening of time series and signals.
This is the method for the aggregate function for objects of class
timeSeries and signalSeries.
Usage
aggregateSeries(x, pos, FUN, moving=FALSE, together=FALSE, drop.empty=TRUE,
include.ends=FALSE, adj, offset, colnames, by, k.by=1,
week.align=NULL, holidays=timeDate(), align.by=TRUE,
incr=1, ...)
Arguments
x |
the series object to be aggregated. |
pos |
the break positions for aggregation (can also be supplied in the |
FUN |
the function to use for aggregation. Often Possible choices for |
moving |
either |
together |
a logical value. if |
drop.empty |
a logical value. If |
include.ends |
a logical value. If |
adj |
if provided, adjusts the positions of the output series so that they lie a
fraction |
offset |
as an alternative to |
colnames |
new column names for the output series. The default is to use the same names as the input series if the output series has the same width. |
by |
if
Alternatively, it can be one of the following character strings:
giving the time units of intervals between values in the sequence. |
k.by |
a non-zero integer giving the width of the interval between consecutive
values in the sequence in terms of the units given in |
week.align |
if not |
holidays |
holidays for business day sequences. (Ignored if |
align.by |
a logical value. If |
incr |
For moving aggregation, the moving window moves forward by this many steps in the time series, for each window. |
... |
Additional arguments to pass to FUN. |
Value
returns a new time series whose positions are the adjusted passed-in positions or
positions generated from by, k.by, and so on,
(or possibly a subset if drop.empty is TRUE) and whose
rows are aggregated from x as specified in the arguments.
Aggregation takes place by separating x into blocks separated by the positions
(or overlapping blocks with a fixed number of samples if moving is
supplied), and then applying FUN to each column (or all columns
together if together is TRUE) and forming a new time series with
the positions and aggregated data.
See Also
timeSeries, signalSeries,
align, aggregate
Examples
x <- timeSeries(data.frame(1:20,rnorm(20)), timeCalendar(d=1:20))
aggregate(x, FUN=mean, by="weeks")
Time Series and Signal Interpolation and Alignment
Description
Aligns or interpolates a time series or signal to new positions.
Usage
align(x, pos, how="NA", error.how="NA", localzone=FALSE, matchtol=0, by,
k.by=1, week.align=NULL, holidays=timeDate())
Arguments
x |
the object to be aligned or interpolated. | ||||||||||||
pos |
the new positions to align or interpolate it to
(either | ||||||||||||
how |
specifies how to treat unmatched positions. Must be one of the following:
| ||||||||||||
error.how |
specifies available actions when an out of bounds error occurs. (Such an error can occur
when
| ||||||||||||
localzone |
if T ( | ||||||||||||
matchtol |
the tolerance for matching positions. Positions that match within | ||||||||||||
by |
if
Alternatively, it can be one of the following character strings:
These strings give the time units of intervals between values in the sequence. | ||||||||||||
k.by |
a non-zero integer giving the width of the interval between consecutive
values in the sequence in terms of the units given in | ||||||||||||
week.align |
if not | ||||||||||||
holidays |
the holidays for business day sequences. (Ignored if |
Details
If either x or pos (or the generated sequence) has zero length,
a zero-length series is returned.
Value
returns a new time series or a signal whose positions are the passed-in positions or
positions generated from by, k.by, and so on, and whose
rows are derived from x as specified in the arguments.
(Can be a subset if how or error.how is "drop".)
See Also
timeSeries, signalSeries, positions, seriesMerge.
Examples
a <- signalSeries(pos=1:10, data=data.frame(a = 11:20, b = 5 * (1:10)))
align(a, c(.2, 3, 7.8, 12), how = "interp", error.how = "nearest")
a <- timeSeries(pos=as(1:10, "timeDate"),
data=data.frame(a = 11:20, b = 5 * (1:10)))
alpos <- as(c(.2, 3, 7.8, 12), "timeDate")
alpos@time.zone <- "JST"
positions(a)@time.zone <- "PST"
align(a, alpos, matchtol = 1, localzone = TRUE)
align(a, matchtol=1, localzone=TRUE, by="days", k.by=2)
Uniform Rectangular Data Functions
Description
Functions that allow you to access all rectangular data objects in the same way. Rectangular data objects include matrices, data frames and vectors.
Usage
as.rectangular(x)
as.char.rect(x)
is.rectangular(x)
subscript2d(x,i,j)
subscript2d(x,i,j) <- value
numRows(x)
numRows(x) <- value
numCols(x)
numCols(x) <- value
rowIds(x)
rowIds(x) <- value
colIds(x)
colIds(x) <- value
Arguments
x |
the object to be converted to rectangular data ( |
i |
the first (row) subscript. |
j |
the second (column) subscript. |
value |
the object to be assign to |
Details
subscript2d, numRows, numCols, rowIds,
colIds can also be used on the left side of assignments. The value can be a character vector, or anything that
can be coerced to a character vector.
-
subscript2dis for subscripting. Whensubscript2dis used in an assignment, it does not allow subscript replacement outside the bounds ofx. Instead, setnumRowsornumColsfirst. When
numRowsornumColsis used in an assignment, the row and column IDs are maintained to have the correct length. Usually, this is done by settingnumRowson the ID vector, but for some objects (for example, data frames) this might not be appropriate, and they have their own methods.Functions
colnames<-andrownames<-simply callcolIds<-androwIds<-, respectively.-
as.rectangularconverts any object to a rectangular data object (usually a data frame), if possible. -
is.rectangulartests whether an object is rectangular. -
numRowsandnumColscount the number of rows and columns. -
rowIdsandcolIds(andrownamesandcolnames) return the row and column names or other identifiers attached to rows and columns. -
colnamesandrownamesreturn the same values ascolIdsandrowIds, respectively, ifdo.NULL=T. Instead of using
namesto replace row names from a matrix, userowIdsordimnames.The functions
colnames,rownames,colnames<-,rownames<-emulate R functions of the same names.
Value
as.rectangular |
returns |
as.char.rect |
takes a rectangular object and returns a rectangular object (vector or matrix) consisting of character strings, suitable for printing (but not formatted to fixed width). |
is.rectangular |
returns |
subscript2d(x, i, j) |
is like |
numRows and numCols |
return integers, like |
rowIds and colIds |
return the IDs of the rows and columns.
These are often character vectors, but need not be,
depending on the class of |
colnames and rownames |
return the same values as
|
See Also
as.data.frame, matrix, Subscript, nrow, dimnames.
Examples
x <- 1:10
y <- list(a=1:10, b=11:20)
is.rectangular(x)
y <- as.rectangular(y)
subscript2d(x,3,1)
subscript2d(y,4,1) <- 55
numRows(x)
numCols(y) <- 3
rowIds(x) <- letters[1:10]
colIds(y)
z <- cbind(1,1:4)
colnames(z)
colnames(z) <- colnames(z)
rownames(z) <- rownames(z)
Dow Jones Industrial Average
Description
High, low, opening, and closing prices and trading volume for the Dow Jones Industrial Average.
The data set has:
The closing price only from 1915 through September 1928.
The high, low, and closing prices from October 1928 through March 9, 1984.
The high, low, opening, and closing prices from March 12, 1984 through December 1986.
The high, low, opening, and closing prices and the trading volume from January 1987 through February 1990.
Format
An object of class timeSeries with the high, low, open and
close prices stored as a data.frame.
Source
Downloaded from the College of Business, Ohio State University web site in early 1990.
Foreign Exchange Rates
Description
Exchange rates between the US Dollar and the
British Pound (GBP)
Canadian Dollar (CAD)
German Mark (DEM)
Japanese Yen (JPY)
Swiss Franc (CHF)
in a multi-variate time series.
Data from Andreas S. Weigend, Bernardo A. Huberman, and David E. Rumelhart, "Predicting Sunspots and Exchange Rates with Connectionist Networks", pp. 395-432 in M. Casdagli and S. Eubank, eds, Nonlinear Modeling and Forecasting, Addison-Wesley, 1992.
Federal Reserve Interest Rates
Description
Interest rate data from the web site of the Federal Reserve Bank, https://www.federalreserve.gov/releases/h15/data.htm, running from 1972 to 1997.
You can find more information on that web site.
Documentation below is derived from the data files.
fed.rate is a multi-variate time series, with the following
columns:
Value
prime.rate |
Bank Prime Loan Rate, daily including weekends and holidays. |
discount.rate |
Discount Rate for the Federal Reserve Bank of New York, daily including weekends and holidays, which is the simple interest rate at which depository institutions borrow from the Federal Reserve Bank of New York. |
fedfunds.rate |
Federal Funds Effective Rate, daily including weekends and holidays, which is the cost of borrowing immediately available funds, primarily for one day. The effective rate is a weighted average of the reported rates at which different amounts of the day's trading through New York brokers occurs. |
mortgage.rate |
Conventional Mortgage Rates for fixed-rate mortgages from the Federal Home Loan Mortgage Corporation, weekly on Fridays. |
High, Low, Open, and Close Calculation
Description
Calculates the high, low, first, and last elements of a vector.
Especially useful for financial trading data in conjunction with
the aggregateSeries function.
Usage
hloc(x)
Arguments
x |
a vector for which to calculate high, low, open, and close. |
Value
returns a vector with four elements:
high |
the maximum value in |
low |
the minimum value in |
open |
the first value of |
close |
the last value of |
x can be an array, but dimensions are ignored.
See Also
Examples
x <- c(5, 2, 3, 6, 3, 2, 1, 7, 1)
hloc(x)
Network Packet Traffic
Description
Time, type, and size for 10,000 network packets
on a local intranet, just before 5PM on March 27, 1998, as
reported by the Unix snoop command. Size is available only
for packets whose type is "TCP" .
Format
An object of class timeSeries with the high, low, open and
close prices stored as a data.frame.
Positions of series Objects
Description
Accesses the positions of series objects.
Usage
positions(object)
positions(object) <- value
Arguments
object |
the object for which to find positions. |
value |
the value to which to set the positions. |
Details
This function can also be used on the left side of an assignment
to set the positions of a series object.
Value
returns the positions slot of object.
See Also
seriesData, timeSeries, signalSeries.
Examples
x <- signalSeries(pos=1:10, data=11:20)
positions(x)
positions(x) <- 11:20
Speech Signal
Description
A signal of a voice saying the word "wavelet" , sampled at 11025 Hz.
There are 8192 samples, ranging in time from 0 to approximately
0.7429 seconds.
Format
The signal is of class signalSeries .
Base Class for Time Series and Signals
Description
A base class representing ordered data objects, such as time series and signals, that have positions (x values, times), and for each position a set of variables (stored in any rectangular data object).
Details
The series class holds x positions and variable data.
It is valid only when the lengths of the positions and data match,
and when the data slot is a rectangular object.
seriesVirtual is a virtual class
corresponding to series. All of the methods
for series objects are defined on the corresponding virtual
seriesVirtual class so they can be inherited easily
by extending classes.
series has two built-in extending classes:
timeSeries and signalSeries. series is not meant to be used directly. Instead, most users should use the
signalSeries and timeSeries classes. Extending classes
should include both series and seriesVirtual in their representations.
Slots
- data
-
(
ANY) the variable data, which can be any data object for whichis.rectangularisTRUE, such as adata.frame,matrix, or atomic vector. - positions
-
(
positions) the x values for the variables. - start.position
-
(
positions) the starting x value. - end.position
-
(
positions) the ending x value. - future.positions
-
(
positions) future x values used for predictions. - units
-
(
character) units for the data. - title
-
(
character) title of the data set. - documentation
-
(
character) user-supplied documentation. - attributes
-
(
ANY) attributes slot for arbitrary use.
Series functions
The
seriesclass has a validity function,seriesValid.The access functions
positionsandseriesDatacan access the positions and data in the object, and they can be used on the left side of assignments.There are also methods defined for
seriesobjects for the following functions:-
nrow -
ncol -
start -
end subscripting
the standard rectangular data functions (see
is.rectangular)basic arithmetic.
-
See Also
timeSeries class, signalSeries class, is.rectangular.
SeriesData of series Objects
Description
Accesses the seriesData of series objects.
Usage
seriesData(object)
asSeriesData(object)
seriesData(object) <- value
seriesDataNew()
seriesDataValid(object)
Arguments
object |
the object for which to find |
value |
the value to which to set |
Details
This function can also be used on the left side of an assignment
to set the seriesData of a series object.
Value
returns the seriesData slot of object.
See Also
positions, timeSeries, signalSeries.
Examples
x <- signalSeries(pos=1:10, data=11:20)
seriesData(x)
seriesData(x) <- 1:10
Time Series Lag/Lead Function
Description
Returns a lagged/leading timeSeries or signalSeries object.
Usage
seriesLag(X, k = 1, trim = FALSE, pad = NA)
Arguments
X |
an object of class |
k |
the number of positions the new time series or signal series is to lag or lead the input series, with a positive value resulting in a lagged series and a negative value resulting in a leading series. |
trim |
a logical flag. If |
pad |
any padding to fill in the beginning or ending missing values.
The default is |
Details
The difference between shift and seriesLag is
that the returned series of shift is shifted in time (position)
while the returned series of seriesLag shifts the entire data slot
but keeps the same time (position) intact.
They all work for both timeSeries and signalSeries objects.
Value
returns a lagged or leading time (signal) series of the original data.
See Also
Examples
x <- timeSeries(data=data.frame(x=1:10, y=11:20),
from="7/4/2000", by="bizdays")
seriesLag(x, 1)
seriesLag(x, -1)
Length of a timeSeries
Description
Returns the length of a timeSeries; that is, it returns the number of positions
in the timeSeries.
Usage
seriesLength(x)
Arguments
x |
an object of class |
Value
returns the length of the timeSeries.
Note
This function is distinguished from the length function, which returns
the number of series in the timeSeries object.
See Also
timeSeries class.
Examples
x <- timeSeries(data=data.frame(x=1:10, y=11:20), from="7/4/2000", by="bizdays")
seriesLength(x)
length(x)
Merging for Time Series and Signals
Description
Merges time series or signal objects, making a new object with all the columns of the input objects, and some or all of the rows, depending on how their positions match.
Usage
seriesMerge(x1, x2, ..., pos=positions(x1), how,
error.how, localzone=FALSE, matchtol=0,
suffixes)
Arguments
x1 |
the first object to be merged. | ||||||||||||
x2 |
the second object to be merged. | ||||||||||||
... |
the other objects to be merged. | ||||||||||||
pos |
the positions to align to, or | ||||||||||||
how |
after the positions to align to are determined, Can be one of the following:
The default is | ||||||||||||
error.how |
specifies what to do in the event of an out of bounds error, which can
occur when Can be one of the following:
The default is | ||||||||||||
localzone |
if | ||||||||||||
matchtol |
the tolerance for matching positions. Positions that match within | ||||||||||||
suffixes |
the suffixes to append to the column names that are duplicated between
the various input data objects. The default value is
|
Value
returns a new series object containing all the columns of all the inputs, and
all the rows of all the inputs, according to the alignment methods described above.
See Also
timeSeries, signalSeries, positions, align, merge.
Examples
a <- signalSeries(pos=1:10, data=data.frame(a = 11:20, b = 5 * (1:10)))
b <- signalSeries(pos=5:14, data=data.frame(a = 11:20, b = 5 * (1:10)))
seriesMerge(a, b)
a <- timeSeries(pos=as(1:10, "timeDate"),
data=data.frame(a = 11:20, b = 5 * (1:10)))
b <- timeSeries(pos=as(5:14, "timeDate"),
data=data.frame(a = 11:20, b = 5 * (1:10)))
seriesMerge(a, b, pos="union")
Create a Shifted Time Series
Description
Returns a time series like the input but shifted in time.
Usage
shift(x, k=1)
Arguments
x |
a univariate or multivariate regular time series.
Missing values ( |
k |
the number of positions the input series is to lead the new series.
That is, the resulting series is shifted forwards in time;
negative values lag the series backwards in time.
Non-integer values of |
Details
shift is a generic function.
Its default method calls lag(x,-k).
shift also has a method
for series objects,
which works for both timeSeries
and signalSeries objects.
To align the times of several new-style time series, use
seriesMerge.To align the times of several old-style time series, use
ts.intersectorts.union.To compute a lagged/leading series with same time position but shifted data slot, use
seriesLag. (seriesLagalso works for bothtimeSeriesandsignalSeriesobjects.)
Value
returns a time series with the same data as x,
but with positions lagged by k steps.
Note
The shift function replaces the lag function,
which illogically had the opposite sign of shifting.
(The lag function has been retained only because
it is used in other functions.)
See Also
seriesMerge,
lag,
lag.plot,
ts.intersect,
ts.union.
Examples
x <- signalSeries(data=data.frame(a=1:10, b=letters[1:10]), positions=1:10)
x5 <- shift(x,5)
seriesMerge(x, x5, pos="union")
Create a signalSeries object
Description
Creates an object of class signalSeries
Usage
signalSeries(data, positions., units, units.position, from = 1, by = 1)
Arguments
data |
( |
positions. |
( |
units |
( |
units.position |
( |
from |
the start of the sequence. |
by |
the increment for the sequence. |
Value
an object of class "signalSeries".
See the
signalSeries class help file
for the names and structure of the slots in the object.
See Also
signalSeries class.
Examples
signalSeries(pos=1:10 , data=1:10)
signalSeries(data=data.frame(x=1:10, y=11:20), from=2, by=2)
signalSeries Class
Description
Represents non-calendar time series and signal objects.
Details
The signalSeries class inherits from the series
and seriesVirtualclasses. It has slots that hold x positions and variable data
inherited from the series class.
A signalSeries object is valid only when the lengths of the positions and data match, the data is a rectangular object,
and the positions slot holds a positionsNumeric object.
Slots
All slots except the last, units.position,
come from the series object.
- data
-
(
ANY) the variable data, which can be any data object for whichis.rectangularisTRUE, such as adata.frame,matrix, or atomic vector. - positions
-
(
positions) the x values for the variables, which must be of typepositionsNumeric. - start.position
-
(
positions) the starting x value. - end.position
-
(
positions) the ending x value. - future.positions
-
(
positions) future x values used for predictions. - units
-
(
character) the units for the data. - title
-
(
character) the title of the data set. - documentation
-
(
character) user-supplied documentation. - attributes
-
(
ANY) the attributes slot for arbitrary use. - units.position
-
(
character) the units for thepositionsslot.
signalSeries functions
You can create objects of class signalSeries using the new function, in
which case they are set up to be empty. Alternatively, you can create objects
of class signalSeries using the signalSeries function.
These objects can be subscripted and used in mathematical operations much like data frames or matrices.
See Also
series class, signalSeries, is.rectangular.
Treasury Bill Auction Rates
Description
Treasury Bill auction rate data running from 1980 to 1997 for 3 month, 6 month, and 1 year durations.
Format
Three separate timeSeries objects with Treasury Bill auction rates:
- tbauc.3m
-
Average of interest rate bids accepted in regular treasury auctions of 13-week bills (also known as 3-month bills). Currently, the auctions are held each Monday for bills to be issued the ensuing Thursday, in the absence of holidays.
- tbauc.6m
-
Average of interest rate bids accepted in regular treasury auctions of 26-week bills (also known as 6-month bills). Currently, the auctions are held each Monday for bills to be issued the ensuing Thursday, in the absence of holidays.
- tbauc.1y
-
Average of interest rate bids accepted in regular treasury auctions of 52-week bills (also known as 1-year bills). Currently, the auctions are held at roughly monthly intervals.
Source
From the web site of the Federal Reserve Bank, https://www.federalreserve.gov/releases/h15/data.htm.
Treasury Bond Futures Trading Data
Description
Treasury Bond futures trading data: high and low prices over 20-minute intervals from January 7, 1994, to February 3, 1995.
It is used to illustrate a drop in bond prices that occurred in 1994.
Format
An object of class timeSeries with the high and low prices
stored as a data.frame.
Source
Downloaded from the Fisher College of Business, Ohio State University web site in early 1996.
Treasury Constant Maturity Curve
Description
Treasury Constant Maturity Curve data running from 1982 to 1997. The Constant Maturity Curve data come from yield curves constructed by the U.S. Treasury Department from the yields of actively traded issues adjusted to constant maturities.
Format
tcm.curve is a multivariate timeSeries object with the following columns:
- three.month
-
Three-month rate.
- six.month
-
Six-month rate.
- one.year
-
One-year rate.
- two.year
-
Two-year rate.
- three.year
-
Three-year rate.
- five.year
-
Five-year rate.
- seven.year
-
Seven-year rate.
- ten.year
-
Ten-year rate.
- twenty.year
-
Constructed from the 20-year Treasury department numbers, based on the 20-year bond through December 1986 (at which time the 20-year bond was discontinued), and from the new computation starting in October of 1993 based on outstanding bonds with approximately 20 years remaining to maturity. There is no data between 1987 and September 1992.
- thirty.year
-
Thirty-year rate.
- long.term
-
An unweighted average of rates on all outstanding bonds neither due nor callable in less than 10 years, also calculated by the Treasury Department.
Source
From the web site of the Federal Reserve Bank, https://www.federalreserve.gov/releases/h15/data.htm.
Create a timeSeries Object
Description
Creates an object of class timeSeries.
Usage
timeSeries(data, positions., units., from = timeCalendar(d = 1,
m = 1, y = 1960), by = "days", k.by = 1, align.by = FALSE,
week.align = NULL)
Arguments
data |
( |
positions. |
( |
units. |
( |
from |
the starting value of the sequence. A |
by |
the spacing between successive values in the sequence. Can be
a Alternatively, it can be one of the following character strings:
giving the time units of intervals between values in the sequence. |
k.by |
a non-zero integer giving the width of the interval between consecutive
values in the sequence in terms of the units given in |
align.by |
a logical value. If |
week.align |
if
In either case, the |
Value
an object of class "timeSeries".
See the
timeSeries class help file
for the names and structure of the slots in the object.
See Also
timeSeries class.
Examples
timeSeries(pos=timeCalendar(d=1:10), data=1:10)
timeSeries(data=data.frame(x=1:10, y=11:20), from="7/4/2000", by="bizdays")
Calendar Time Series Class
Description
Represents calendar time series objects.
Details
The timeSeries class inherits series and seriesVirtual.
From series, it inherits slots that hold x positions and variable data.
A timeSeries object is valid only when the lengths of the positions and
data match, the data slot is rectangular,
and the positions slot holds a positionsCalendar object.
Slots
All slots except the last two, fiscal.year.start and type,
are inherited from the base series class.
- data
-
(
ANY) the variable data, which can be any data object for whichis.rectangularisTRUE, such as adata.frame,matrix, or atomic vector. - positions
-
(
positions) the x values for the variables, which must be of typepositionsCalendar. - start.position
-
(
positions) the starting x value. - end.position
-
(
positions) the ending x value. - future.positions
-
(
positions) future x values used for predictions. - units
-
(
character) the units for the data. - title
-
(
character) the title of the data set. - documentation
-
(
character) user-supplied documentation. - attributes
-
(
ANY) the attributes slot for arbitrary use. - fiscal.year.start
-
(
numeric) the month number for fiscal year start. - type
-
(
character) the type of time series.
Series functions
You can create objects of class timeSeries using the
new function, in which case they are set up to be empty
and have their fiscal year starting in January. Alternatively, you
can create objects of class timeSeries using the timeSeries
function.
These can be subscripted and used in mathematical operations much like data frames or matrices.
See Also
series class, timeSeries,
is.rectangular.
Update Old ts Objects
Description
Converts an old ts object to a signalSeries object.
Usage
ts.update(x)
Arguments
x |
the time series to convert. |
Value
returns a signalSeries object with equivalent positions.
See Also
Examples
ts.update(ts(1:10))
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 |
matchtol |
the tolerance for matching positions. Positions that match within |
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,
align,
seriesMerge.
Examples
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)