From charlie at stat.umn.edu  Sat Oct 23 05:59:13 2010
From: charlie at stat.umn.edu (Charles Geyer)
Date: Fri, 22 Oct 2010 22:59:13 -0500
Subject: [Rd] possible error checking bug and documentation bug in ts
Message-ID: <AANLkTinR7fexy5Z3g3EnWx9sCLev7_hXoJCXyXHKS0Wj@mail.gmail.com>

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
charlie at stat.umn.edu



[Rd] possible error checking bug and documentation bug in ts
Charles Geyer