[R] tsdiag() titles

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Nov 15 17:36:11 CET 2004


Did you notice that tsdiag() plots about three plots and gives each a 
title?

You can add a title to the array of plots using title(outer=TRUE), 
surprisingly enough, but you will need to adjust the outer margins to make 
room for it.  Something like

par(oma=c(0,0,2,0))
fit <- arima(lh, c(1,0,0))
tsdiag(fit)
title("Some title or another", outer = TRUE)


On Mon, 15 Nov 2004, Andrew Kniss wrote:

> I am using the ts package to fit ARIMA models, and the tsdiag() function to
> plot diagnostics.  In doing so I'm generating an awful lot of diagnostic
> plots of different models and different data sets all within the same R
> session.  So my question is, is there an option in tsdiag() similar to
> <main="Title"> that I can use?  This would be quite helpful when I print out
> the plots, so I can tell which plot goes with a particular data set and
> model.  I can't seem to find any examples where this has been done, and no
> options (other than gof.lag) are listed in the R manual.
>
> library(ts)
> data(tbills)       #Treasury Bills
> attach(tbills)
> ts.tbills<-ts(tbills)
> diff.tbills<-diff(ts.tbills)  #Differenced Series
> arima.diff.tbills.100<-arima(ts.tbills, order=c(1,0,0))
> win.metafile("HW_ARIMA/tbill1.wmf")
>  tsdiag(arima.diff.tbills.100, main="Treasury Bills")  #main= does not
> work, is there a way to name the plot?
> dev.off()
>
>  
> Thanks for any help or ideas.
>  
> Andrew Kniss
> Assistant Research Scientist
> University of Wyoming
> Dept. 3354 
> 1000 E. University Ave.
> Laramie, WY  82071
> (307) 766-3949
> akniss at uwyo.edu
>
>

-- 
Brian D. Ripley,                  ripley at 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


More information about the R-help mailing list