Re: [R] cbind for list of zoo objects

2013-04-09 Thread Harry Mamaysky
That's a nice solution. Thanks. Sent from my iPhone On Apr 9, 2013, at 10:00 AM, Gabor Grothendieck wrote: On Tue, Apr 9, 2013 at 9:15 AM, Harry Mamaysky 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 generat

Re: [R] cbind for list of zoo objects

2013-04-09 Thread Gabor Grothendieck
On Tue, Apr 9, 2013 at 9:15 AM, Harry Mamaysky 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-determinis

Re: [R] cbind for list of zoo objects

2013-04-09 Thread Harry Mamaysky
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

Re: [R] cbind for list of zoo objects

2013-04-09 Thread Joshua Ulrich
On Tue, Apr 9, 2013 at 7:31 AM, Harry Mamaysky wrote: > Thanks for the explanations. > > Wouldn't the following bit of checking in do.call() make it easier to figure > such things out in the future? > Sure, it would have helped you figure out your issue, but you don't want a *warning* when you pu

Re: [R] cbind for list of zoo objects

2013-04-09 Thread Harry Mamaysky
Thanks for the explanations. Wouldn't the following bit of checking in do.call() make it easier to figure such things out in the future? my.call <- function(what,args,...) { ## Get the name of the function to call. if (!is.character(what)) whatStr <- deparse(substitute(what)) el

Re: [R] cbind for list of zoo objects

2013-04-08 Thread Gabor Grothendieck
On Mon, Apr 8, 2013 at 3:54 PM, Harry Mamaysky wrote: > Can someone explain why this happens when one of the list elements is named > 'all'? > >> zz <- list( zoo(1:10,1:10), zoo(101:110,1:10), zoo(201:210,1:10) ) >> names(zz)<-c('test','bar','foo') >> do.call(cbind,zz) >test bar foo > 1

Re: [R] cbind for list of zoo objects

2013-04-08 Thread Joshua Ulrich
Because 'all' is the name of one of the arguments to cbind.zoo: R> args(cbind.zoo) function (..., all = TRUE, fill = NA, suffixes = NULL, drop = FALSE) NULL do.call constructs a call somewhat like: R> cbind(test=zz$test, all=zz$all, foo=zz$foo) The same thing would happen for list elements named