[R] minor diagonal in R

Peng, C cpeng.usm at gmail.com
Tue Sep 7 15:26:09 CEST 2010


This this what you want?

> A=matrix(1:16,ncol=4)
> A
     [,1] [,2] [,3] [,4]
[1,]    1    5    9   13
[2,]    2    6   10   14
[3,]    3    7   11   15
[4,]    4    8   12   16
> diag(A[1:4,4:1])
[1] 13 10  7  4
> 

-- 
View this message in context: http://r.789695.n4.nabble.com/minor-diagonal-in-R-tp2529676p2529710.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list