[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?

>
> How can I extract (other than manual copy)

Huh?

> 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  
example:

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

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