remove seasonality from weekly time series data I need to decompose a series to remove seasonality. The series has 2 columns date and volume.

This is what my time series object looks like:

salestsDec &lt;- ts(salests, frequency=52, start=c(2010, 1), end=c(2014,12))


I ran the decompose() function on a 'ts' object.

salests = sales[, c(1,6)]
View(salests)
salestsDec &lt;- ts(salests, frequency=52, start=c(2010, 1), end=c(2014,12))
salestsDec &lt;- decompose(salestsDec, type=c("additive"))
plot(salestsDec)


Upon, running the decompose() function, I get a list of 6 components, observed, trend, seasonal, random for both date and volume. I should only be seeing, observed, trend, seasonal and random component for Volume in my plot.

I've attached an image of what the plot looks like.

Moreover, when I try to remove seasonal component from the series, I am getting an error. It appears that it's the same underlying issue.

Error:

Error in salests - salestsDec$seasonal : non-numeric argument to binary operator In addition: Warning message: Incompatible methods ("Ops.data.frame", "Ops.ts") for "-"
I can't replicate (without having the data), but from what I see, you are trying to apply the decompose function to the entire object - it's probably expecting a single vector, but receives a data-frame-like object and attempts to apply the decomposition to both columns. either use a different time series package (like zoo) which does not store timestamps as a column, or apply decompose explicitly to salestsDec[,2].