I used the STL function in the {stats} package to seasonally detrend some time series data.
I would now like the results exported to csv, but when I try
write.csv(mySTLdata, "mySTLdata.csv")
I get the error
Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) :
cannot coerce class ""stl"" to a data.frame
If I try to just convert the STL to a data.frame, it again tells me it cannot be coerced into one.
Any ideas on how I can get this out of the R environment for use elsewhere?