Yes,Ii did fail to read your post carefully and agree  do.call seems 
roundabout, but alternatives look even more tortured.

(You might want to include more context in the future.)

On Nov 1, 2011, at 8:30 PM, Ernest Adrogué <eadro...@gmx.net> wrote:

> 1/11/11 @ 20:22 (-0400), Comcast escriu:
>> Leaving the indices empty should give you what I'm guessing you want/expect.
>> 
>> x[,,2]    #.  TRUE would also work, just not in a list.
> 
> Exactly, but this only works if x has three dimensions. What I want is
> x[,,2] if x has three dimensions, x[,,,2] if it has four, and so
> forth. I cannot hard code [,,2] because I do not know how many
> dimensions x will have, instead the subscript has to be built "on the
> fly".
> 
> Ernest

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to