TimeSeriesSubsettings {timeSeries} | R Documentation |
Subsetting time series
Description
Subset a "timeSeries"
objects in different ways.
[ | "[" method for a "timeSeries" object, |
[<- | "[<-" method to assign value for a subset of a "timeSeries" object, |
head | Returns the head of a "timeSeries" object, |
tail | Returns the tail of a "timeSeries" object, |
outlier | Removes outliers from a "timeSeries" object. |
Usage
## S4 method for signature 'timeSeries'
head(x, n = 6, recordIDs = FALSE, ...)
## S4 method for signature 'timeSeries'
tail(x, n = 6, recordIDs = FALSE, ...)
## S4 method for signature 'timeSeries'
outlier(x, sd = 3, complement = TRUE, ...)
Arguments
x |
an object of class |
n |
an integer specifying the number of lines to be returned.
By default |
recordIDs |
a logical value. Should the |
sd |
a numeric value of standard deviations, e.g. 10 means that values larger or smaller tahn ten times the standard deviation will be removed from the series. |
complement |
a logical flag, should the outler series
or its complement be returns, by default |
... |
arguments passed to other methods. |
Value
All functions return an object of class "timeSeries"
.
Examples
## Create an Artificial 'timeSeries' Object -
setRmetricsOptions(myFinCenter = "GMT")
charvec <- timeCalendar()
set.seed(4711)
data <- matrix(exp(cumsum(rnorm(12, sd = 0.1))))
tS <- timeSeries(data, charvec, units = "tS")
tS
## Subset Series by Counts "[" -
tS[1:3, ]
## Subset the Head of the Series -
head(tS, 6)
[Package timeSeries version 4030.106 Index]