New to R Studio,need to decompose data using DWT

Hello,having challenges in decomposing a data set of 72 observations of 1 variable (Depth(m)) to a daubechies 4 order, n levels=4.,What could be the issue in the argument?
WELL1 <- read_excel("C:/Users/User/Desktop/DWT-WA-SVR/WELL1.xlsx")
Depth <- dwt(up.sample(Data[,c("DEPTH (m)")],1, wf="la8", n.levels=4, boundary="periodic")
Depth <- data.frame(DEPTH(m)$d1,DEPTH(m)$d2,DEPTH(m)$d3,DEPTH(m)$d4,DEPTH(m)$s4)
Depth <- ts(Depth,start = c(1), freq =1 )
plot.ts(Data)

My guess that the problem is that after assigning the excel info to object WELL1 you then don't do anything with it.

Thought so too initially but even after running that argument
A new problem arises..

WELL1 <- read_excel("C:/Users/User/Desktop/DWT-WA-SVR/WELL1.xlsx")
Depth <- dwt(Data[, c("DEPTH (m)")], wf="la8", n.levels=4, boundary="periodic")
Error in dwt(Data[c("DEPTH (m)")], wf = "la8", n.levels = 4, boundary = "periodic") :
Sample size is not divisible by 2^J
What could be the problem?

WELL1 in this code still serves no purpose. After it is assigned on the first line of your code. No other line
of your code mentions it. Are you confusing it with Data ?

Oh yeah okay thanks seen the issue..but new problem...

Depth <- dwt(up.sample(Data[, c("DEPTH (m)")], f - 1), wf="la8", n.levels=4, boundary="periodic")
Error in matrix(rep(y, (f - 1) * n), nrow = f - 1) : object 'f' not found

What does f mean in upsampling

Assuming your up.sample comes from this waveslim package.
The documentation says

Arguments

x

vector of observations

f

frequency of upsampling; e.g, 2, 4, etc.

y

value to upsample with; e.g., NA, 0, etc.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.