I'm trying to locate outliers in a time series using the tsoutliers package.
I'm using the classic Nile dataset (which you can find here: https://vincentarelbundock.github.io/Rdatasets/datasets.html) and I'm unsucessfully getting the tso() function to work.
My code is:
nile.outliers <- tso(Nile,types = c("AO","LS","TC"))
However, I get this syntax error, or what I assume is a syntax error:
Error in tso0(x = y, xreg = xreg, cval = cval, delta = delta, n.start = n.start, : trying to get slot "y" from an object (class "data.frame") that is not an S4 object
If anyone can help me figure out this problem that would be amazing! Thanks!