filter  R Documentation 
Applies linear filtering to a univariate "timeSeries"
.
## S4 method for signature 'timeSeries'
filter(x, filter, method = c("convolution", "recursive"), sides = 2,
circular = FALSE, init = NULL)
x 
an object from class 
filter 
coefficients of the filter. 
method 

sides , circular 
for convolution filters only. Onesided if 
init 
for recursive filters only. Values before the start of the time series. 
filter
is a generic function with default method
stats::filter
. The method for "timeSeries"
is a wrapper
for the latter.
See ?stats::filter
for details about the arguments.
a "timeSeries"
object
base R function filter
## Creata a dummy signal 'timeSeries' 
data < matrix(rnorm(100), ncol = 2)
s < timeSeries(data, units=c("A", "B"))
head(s)
## Filter the series 
f < filter(s, rep(1, 3))
head(f)
## Plot and compare the first series 
plot(cbind(s[, 1], f[, 1]), plot.type="s")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.