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
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
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
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
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
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
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
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 1 101 201
2 2 102 202
3 3 103 203
4 4 104 204
5 5 1
8 matches
Mail list logo