possible error checking bug and documentation bug in ts

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

possible error checking bug and documentation bug in ts

Charles Geyer
The documentation for ts says "Only one of ‘frequency’ or ‘deltat’ should
be provided" but why doesn't it enforce this with

    stopifnot(missing(frequency) || missing(deltat))

Wouldn't that work?  Also the documentation does not say what valid
time series parameters are.  To find that out one must know to RTFS
in src/main/attrib.c and find that

    end - start  = (n - 1) / frequency

or

   end - start  = (n - 1)  * deltat

is required to avoid an error, where
n is either length(data) or nrow(data).
Why can the help page for ts say that?

I suppose this is picky, but a newbie just wasted a couple of days
with the mysterious error thrown in badtsp in src/main/attrib.c
when he ran afoul of R's argument matching rules and
unintentionally supplied both frequency and deltat (thinking he
was supplying deltat and ts.eps).  It took me more time that it
should have to figure it out too.
--
Charles Geyer
Professor, School of Statistics
University of Minnesota
[hidden email]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel