[R] ts; decompose; plot and title

Gabor Grothendieck ggrothendieck at gmail.com
Tue Feb 27 18:34:12 CET 2007


Try this:

plot(cbind(observed = z$random +
    z$trend * z$seasonal, trend = z$trend, seasonal = z$seasonal,
        random = z$random), main = "My title")

Change the * to + if your setup is additive.

On 2/27/07, Alberto Monteiro <albmont at centroin.com.br> wrote:
> Is there any way to give a "decent" title after I plot something
> generated by decompose?
>
> For example:
>
> # generate something with period 12
> x <- rnorm(600) + sin(2 * pi * (1:600) / 12)
>
> # transform to a monthy time series
> y <- ts(x, frequency=12, start=c(1950,1))
>
> # decompose
> z <- decompose(y)
>
> # plot
> plot(z)
>
> Now, the title is the ugly "Decomposition of additive time series".
> How can do this with a decent title, like "Analysis of UFO abductions"?
>
> Alberto Monteiro
>
> ______________________________________________
> R-help at 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
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list