0

I am doing Wavelet Analysis in R using Biwavelet. However, I receive the error message:

Error in check.datum(y) : The step size must be constant (see approx function to interpolate)

When I run the following code:

wtc.AB = wtc(t1, t2, nrands = nrands)

Please share your help here. Complete Code is:

# Import your data
Data <- read.csv("https://dl.dropboxusercontent.com/u/18255955/Tutorials/Commodities.csv")
# Attach your data so that you can access variables directly using their
# names
attach(Data)
# Define two sets of variables with time stamps
t1 = cbind(DATE, ISLX)
t2 = cbind(DATE, GOLD)
# Specify the number of iterations. The more, the better (>1000).  For the
# purpose of this tutorial, we just set it = 10
nrands = 10
wtc.AB = wtc(t1, t2, nrands = nrands)
# Plotting a graph
par(oma = c(0, 0, 0, 1), mar = c(5, 4, 5, 5) + 0.1)
plot(wtc.AB, plot.phase = TRUE, lty.coi = 1, col.coi = "grey", lwd.coi = 2, 
    lwd.sig = 2, arrow.lwd = 0.03, arrow.len = 0.12, ylab = "Scale", xlab = "Period", 
    plot.cb = TRUE, main = "Wavelet Coherence: A vs B")```
  • Sorry I can't open the connection to your csv dataset in Dropbox. – Abdur Rohman Aug 21 '21 at 13:06
  • That's a sample code available on the net. No one has access to that. I follow the codes written there but receive the error message in response. – ناصر رحمان Aug 21 '21 at 15:11
  • Could you please provide a toy dataset that reproduce the error message? I found some other users encounter similar problems but none of them provide usable dataset. – Abdur Rohman Aug 23 '21 at 09:03

0 Answers0