[R] array slice notation?

Steve Jaffe sjaffe at riskspan.com
Tue Aug 4 21:23:36 CEST 2009


Suppose I have an n-diml array A and I want to extract the first "row" -- ie
all elements A[1, ...]

Interactively if I know 'n' I can write A[1,,,,,] with (n-1) commas. 

How do I do the same more generally, eg in a script?

(I can think of doing this by converting A to a vector then extracting the
approp elements then reshaping it to an array, but I wonder if there isn't a
more straightforward approach)
Thanks

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




More information about the R-help mailing list