[R] cbind for list of zoo objects

Gabor Grothendieck ggrothendieck at gmail.com
Tue Apr 9 16:00:01 CEST 2013


On Tue, Apr 9, 2013 at 9:15 AM, Harry Mamaysky <h.mamaysky at gmail.com> wrote:
> That's true. So perhaps there should be a flag that turns on this error checking. Often "args" is just a list that gets generated automatically and you don't know what all of its elements are. It just leads to a bit of non-deterministic behavior. It would be useful to have the option of flagging when one of those list elements (inadvertently) has the same name as an argument of "what".
>

You can force an error by specifying all the default arguments.  Using
the version of zz with an all component it will encounter all= twice:

> do.call(cbind, c(zz, all = TRUE, fill = NA, suffixes = list(NULL), drop = FALSE))
Error in cbind(deparse.level, ...) :
  formal argument "all" matched by multiple actual arguments

or more compactly:

> do.call(cbind, c(zz, formals(zoo:::cbind.zoo)[-1]))
Error in cbind(deparse.level, ...) :
  formal argument "all" matched by multiple actual arguments


--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-help mailing list