Re: [R] Using a list as multidimensional indexer

2011-01-20 Thread Nick Sabbe
Hm. I got somewhat further: Ind2<-list(Mm,"b","g") do.call("[",Ind2) Seems to work. However, now I need it one step beyond: in fact, my actual multidimensional object holds one dimension more than my list holds indexes. i.e.: I want the equivalent of Mm["a",]. I tried some variants of Ind3<-list

Re: [R] Using a list as multidimensional indexer

2011-01-20 Thread Prof Brian Ripley
On Thu, 20 Jan 2011, Nick Sabbe wrote: Hello list. Another 'puzzle' for which I don't have a clean solution. Say I have a multidimensional object, e.g.: Mm<-matrix(1:6, nrow=2, dimnames=list(c("a","b"), c("g","h","i"))) And on the other hand I have a list Ind<-list("b","g") This holds, for each