# NOT RUN {
old.par <- par(no.readonly=TRUE)
t <- (-100:100)
y <- sin(t*2*pi)+sin(t*2*pi/4)+sin(t*2*pi/8)+sin(t*2*pi/16)+sin(t*2*pi/32)+sin(t*2*pi/64)
x1 <- sin(t*2*pi/16)
x2 <- sin(t*2*pi/32)
x3 <- sin(t*2*pi/64)
y <- cbind(t,y)
x1 <- cbind(t,x1)
x2 <- cbind(t,x2)
x3 <- cbind(t,x3)
## Quadruple wavelet coherence
result <- qmwc(y, x1, x2, x3, nrands = 10)
# }
# NOT RUN {
result <- qmwc(y, x1, x2, x3)
# }
# NOT RUN {
## Plot wavelet coherence and make room to the right for the color bar
## Note: plot function can be used instead of plot.vectorwavelet
par(oma = c(0, 0, 0, 1), mar = c(5, 4, 4, 5) + 0.1, pin = c(3,3))
plot.vectorwavelet(result, plot.cb = TRUE, main = "Plot quadruple wavelet coherence")
par(old.par)
# }
Run the code above in your browser using DataLab