[R] extend.series not zero padding

Keith Chamberlain Keith.Chamberlain at colorado.edu
Tue Dec 6 06:45:25 CET 2005


Dear List,

I was trying to verify that I could use extend.series in the wavelets
package and kept getting an error when trying to use method="zero". I'm not
seeing where my syntax has gone awry.

According to the documentation, [see ?extend.series]
"  method: A character string indicating which extension method to use.
          Possible values are '"periodic"', '"reflection"', '"zero"',
          '"mean"', and '"reflection.inverse"'."

c<-cbind(0:60, 60:0) # setup a series, length will be 61
> length(c)
[1] 122

>dew<-extend.series(c,method="zero",length="powerof2",
j=log(length(c),2)%/%1)
>Error in extend.series(c, method = "zero", length = "powerof2", j =
log(length(c),  : 
        Invalid argument value for 'method'

Other methods work great, such as method="mean".

> dew<-extend.series(c,method="mean",length="powerof2",
j=log(length(c),2)%/%1)
>

> length(dew)
[1] 128
>

Has this come up in anyone else's experience? If so, what's the workaround
so that I can use "zero" as a method?

Rgds,
KeithC.




More information about the R-help mailing list