[R] array slice notation?

Steve Jaffe sjaffe at riskspan.com
Tue Aug 4 23:00:03 CEST 2009


correction -- that would work for a single row, if you want the result to be
an array with one fewer dimensions. But in general you get an array of the
same dimension you started with (where the first dimension may be length 1).
So:

dim(slice) <- c(length(v), dim(arr)[-1])


Although you *do* have to re-assign the dimensions, otherwise the result is
just a flat vector, ie
 

-- 
View this message in context: http://www.nabble.com/array-slice-notation--tp24814643p24816190.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list