hi guys: sorry, one more. I have irregularly spaced time series, often with big gaps. a good analogy is: tsvec <- ts(c(1,NA,2,NA,1, NA, 2),freq=12, start=c(1965,12)) Unfortunately, plot( tsvec ) does not plot the data. is it possible to convince plot to just ignore the NA items (either with points or lines) help appreciated. /iaw
On Sun, 18 May 2003, Welch, Ivo wrote:> hi guys: sorry, one more. I have irregularly spaced time series, often > with big gaps. a good analogy is: > > tsvec <- ts(c(1,NA,2,NA,1, NA, 2),freq=12, start=c(1965,12)) > > Unfortunately, plot( tsvec ) does not plot the data. is it possible to > convince plot to just ignore the NA items (either with points or lines)It does with type="p" or type="b". As every other point is missing in your example, there are no non-missing segments to plot with type="l" (the default). If you don't want the missing points noticed, don't use ts() which is designed for regular times series. (I believe that package tseries has the beginnings of support for irregular series in recent versions.) -- 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
hi brian: first, thank you very much for your help. very highly
appreciated.
I have read/am reading the R and plot documentations, but it will take a
while to absorb it all. may I ask 2 more itsy queries, please? I hope
they are the 5 second type questions for someone in the know.
* if 2 time-series are plotted with one plot command, they are below one
another. if 6 are plotted, they are in a 2c*3r array. which parameter
allows me to control this behavior?
* is it possible to run a batch command that leaves the figure window
where it is? or, that waits for user input, so that my batch command
can plot a figure, wait until I look at it, plot the next figure, etc.?
("scan() in a BATCH command does not wait.")
incidentally, for gnuplot, I found it very helpful that people had
posted sample sessions on the web that contain a variety of commands
with output and comments on what did what. google works quite well for
searching over many such sample sessions to find something that does
what one needs. there are R examples here and there (and especially in
the docs), and they are extremely useful; but, it would be nicer if
this was more random but searchable stuff.
regards,
/iaw