Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

[R] extend.series not zero padding

Keith Chamberlain

2005-12-06

Replies:

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.

______________________________________________
R-help@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
©2008 r-help.com - Jax Systems, LLC, U.S.A.