1.4.2
by Dirk Eddelbuettel
Import upstream version 0.6-14 |
1 |
panel.tskernel <- |
2 |
function(x, y, ..., |
|
3 |
width = NROW(x) %/% 10 + 1, n = 300, |
|
4 |
c = 1, sides = 2, circular = FALSE, |
|
5 |
kern = kernel("daniell", rep(floor((width/sides)/sqrt(c)), c))) |
|
6 |
{
|
|
7 |
if (!missing(kern)) |
|
8 |
.Deprecated("The 'kern' argument to panel.tskernel is Deprecated. Use simpleSmoothTs directly.") |
|
9 |
if (!missing(y)) { |
|
10 |
x <- as.numeric(x) |
|
11 |
y <- as.numeric(y) |
|
12 |
stopifnot(NCOL(x) == 1) |
|
13 |
if (diff(range(diff(x))) > getOption("ts.eps")) |
|
14 |
stop("'x' should be a regular series") |
|
15 |
x <- ts(y, start = x[1], end = tail(x,1), deltat = diff(x[1:2])) |
|
16 |
}
|
|
17 |
x <- as.ts(x) |
|
18 |
s <- simpleSmoothTs(x, width = width, c = c, sides = sides, |
|
19 |
circular = circular, kern = kern, n = n) |
|
20 |
panel.lines(s, ...) |
|
21 |
}
|
|
22 |