There seems to be a bug in seq.Date such that it will not allow the user
to pass in length.out =3D NULL, despite the fact that this is the =
default
argument.
For example:
Error in seq.Date(dt1, dt2, length.out =3D NULL, by =3D "day") :=20
'length.out' must be of length 1
This might be an issue if I want to wrap seq.Date in another function
that reports or modifies on length.out. For instance, suppose I want to
create a simple function that simply reports when length.out is NULL (or
missing), as below, but otherwise works identically to seq.Date.
FUN <- function(to, from, length.out =3D NULL, by, ...) {
if (is.null(length.out)) cat("length.out is missing\n")
seq.Date(to, from, length.out =3D length.out, by =3D by, ...)
}
length.out is missing
Error in seq.Date(dt1, dt2, length.out =3D NULL, by =3D "day") :=20
'length.out' must be of length 1
I believe the patch to fix this error is as follows (on R2.4.0(alpha)
Revision 39430)
- } else if (!missing(length.out)) {
+ } else if (!missing(length.out) && !is.null(length.out)) {
Another (perhaps better) patch would be to not have NULL be the default
for length.out.
HTH,
Robert
Robert McGehee
Quantitative Analyst
Geode Capital Management, LLC
53 State Street, 5th Floor | Boston, MA | 02109
Tel: 617/392-8396 Fax:617/476-6389
mailto:robert.mcgehee at geodecapital.com
This e-mail, and any attachments hereto, are intended for us...{{dropped}}