[R] logical indexing multidimensional arrays

Steve Jaffe sjaffe at riskspan.com
Thu Jun 4 21:07:48 CEST 2009


Suppose I have an n-dimensional array and a logical vector as long as the
first dimension. I can extract an n-dimensional subarray with 
  a[ i, , , , .. ,] where there are n-1 commas (ie empty indices)

Is there an alternative notation that would better lend itself to more
generic use, e.g. to write a function that takes 'a' and 'i' and returns
a[i, , , .. ,]?

-- 
View this message in context: http://www.nabble.com/logical-indexing-multidimensional-arrays-tp23875985p23875985.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list