[R] Extract data from tseries stl function

David Winsemius dwinsemius at comcast.net
Thu Oct 15 00:13:21 CEST 2009

On Oct 14, 2009, at 5:05 PM, nmo wrote:

> I have generated a table using the stl function from tseries.


> How can I extract (other than manual copy)


> data from a column (eg trend)

First you look at the structure of the object. In my case, since you  
did not provide a worked example (ggrrrr), I used the first help page  

stllc <- stl(log(co2), s.window=21)

Then you can see where the data resides:

stllc$time.series[ ,"trend"]

> -- 

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

More information about the R-help mailing list