[R] Yet another beginner question

Uwe Ligges ligges at statistik.uni-dortmund.de
Tue Sep 9 08:57:38 CEST 2003


Peter Flom wrote:

> Thanks for all the help on my earlier questions.....
> 
> 
> How do you plot a simple time series with unequal intervals?  I have
> the following
> 
> dateofpoll <- as.ts(c("6/1/02", "7/1/02", "10/1/02", "1/4/03",
> "1/25/03",
> "6/7/03", "7/16/03", "8/17/03", "9/4/03"))
> reelect <- c(51, 47, 49, 51, 49, 49, 46, 45, 40)
> new <-     c(28, 32, 35, 36, 41, 38, 47, 48, 52)
> 
> what I'd like is to plot reelect and new  (maybe with smoothing) on a
> time scale, with the x axis labeled for date.....
> 
> But I can't figure out how, despite looking at ?ts and various things
> there
> 
> 
> Thanks in advance

You can do it by converting to POSIX format, but a more convinient way 
is provided by the new contributed package "its" (Irregular Spaced 
Time-Series, on CRAN) by Giles Heywood (I have not tested it, though),
see the announcement: 
https://www.stat.math.ethz.ch/pipermail/r-announce/2003/000768.html

Uwe Ligges



> Peter L. Flom, PhD
> Assistant Director, Statistics and Data Analysis Core
> Center for Drug Use and HIV Research
> National Development and Research Institutes
> 71 W. 23rd St
> www.peterflom.com
> New York, NY 10010
> (212) 845-4485 (voice)
> (917) 438-0894 (fax)
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list