Problem generating wavelet variance/covarance

How do I solve the error?

Here's my script:

A=x B=y wf <- "la8" J <- 8 N<- length(A) A.modwt <- modwt(A, wf, J) B.modwt <- modwt(B, wf, J) A.modwt.bw <- brick.wall(A.modwt, wf) B.modwt.bw <- brick.wall(B.modwt, wf) WCOV = wave.covariance(A.modwt.bw, B.modwt.bw) Error in x[c((n%/%2):n, 1:(n%/%2 - 1))] : only 0's may be mixed with negative subscripts

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum