This question is rather vague but has anyone used the biwavelet package in R and been successful? I have the following code:
require(biwavelet)
t1 <- cbind(DecTime,Temp)
## continuous wavelet transform
wt1 <- wt(t1)
plot(wt1)
and it returns the error:
Error in image.default(x$t, yvals, t(zvals), zlim = zlims, ylim = rev(range(yvals)), : 'x' and 'y' values must be finite and non-missing
I dont understand this error because my data does not contain any missing values and they are all finite.
When trying to reproduce the example:
require(biwavelet)
Date = seq(from=as.POSIXct("2011-01-01 00:00"),
to=as.POSIXct("2011-12-31 23:00"), length=8760)
DecTime = julian(Date, Date[1])
data=cbind(as.numeric(DecTime), rnorm(8760))
## Continuous wavelet transform
wt.t1=wt(data)
plot(wt.t1)
It annoyingly works, therefore I do not know why my data fails in this package. The data in the above example is the same class as my data i.e. 'matrix'. Any help or advise would be appreciated.
Altered:
require(biwavelet)
Date = seq(from=as.POSIXct("2011-01-01 00:00"),
to=as.POSIXct("2011-12-31 23:00"), length=8760)
DecTime = julian(Date, Date[1])
D <- c(4.0267, 4.0211, 4.0005,4.0042,4.0042,4.0191)
data=cbind(as.numeric(DecTime[1:6]),as.numeric(D))
## Continuous wavelet transform
wt.t1=wt(data)
plot(wt.t1)
> data
[,1] [,2]
[1,] 0.00000000 4.0267
[2,] 0.04166667 4.0211
[3,] 0.08333333 4.0005
[4,] 0.12500000 4.0042
[5,] 0.16666667 4.0042
[6,] 0.20833333 4.0191
> class(data)
[1] "matrix"
> class(data[,1])
[1] "numeric"
> class(data[,2])
[1] "numeric"
> wt.t1=wt(data)
> plot(wt.t1)
Error in image.default(x$t, yvals, t(zvals), zlim = zlims, ylim = rev(range(yvals)), :
invalid z limits