# 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/8)
x2 <- sin(t*2*pi/32)
y <- cbind(t,y)
x1 <- cbind(t,x1)
x2 <- cbind(t,x2)
## Multiple wavelet coherence
result <- mwc(y, x1, x2, nrands = 10)
# }
# NOT RUN {
result <- mwc(y, x1, x2)
# }
# 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 multiple wavelet coherence")
par(old.par)
# }
Run the code above in your browser using DataLab