Re: [R] ts and stl functions

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Thu 13 Jul 2006 - 00:41:15 EST

On Wed, 12 Jul 2006, Daniel sutcliffe wrote:

> Hi,
>
> I have imported a csv file into R which contains one column (the rate er 100,000 population of a disease, by month over 11 years) I coerced into a time series using the following function,
>
> tstkr<-ts(tkr,deltat=1/12)

That's likely making a ts out of a data frame and not the one column of the data frame. What does dim(tkr) say?

>
> This seems to work fine, and when I check for the class of the object using class(tstkr) I get "ts" as the response.
>
> When I try to use the stl function in stats I get the error message:
>
> Error in stl(tstkr)only univariate series are allowed
>
> I then tried this:
>
> tstkr <- ts(c(tkr), deltat=1/12)
>
> however this made no difference...I still get an error - does anybody know what is wrong?

Try tkr[[1]]

>
> Regards,
>
> Daniel
>
>
> ---------------------------------
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Thu Jul 13 02:03:33 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 13 Jul 2006 - 04:21:37 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.