I am writing this code about Male Employment Data, and trying to apply classical decomposition, but I keep getting this:
Warning: 1 error encountered for classical_decomposition(Value, type = "additive")
[1] .data contains implicit gaps in time. You should check your data and convert implicit gaps into explicit missing values using `tsibble::fill_gaps()` if required.
The thing is that there are no gaps in my dataset.
Here is my full code:
# Read the CSV file
employment <- read.csv("LNS12000001.csv")
# Convert DATE column to Date type
employment$DATE <- as.Date(employment$DATE)
# Convert to tsibble
male_employment <- as_tsibble(employment, index = DATE)
male_employment <- male_employment |> rename(Value = LNS12000001)
print(male_employment)
# Apply Classical Decomp
male_employment |> model(classical_decomposition(Value, type = "additive")) |> components() |> autoplot() + xlab("Year") + ggtitle("Classical additive decomposition of US Male employment")
1