It looks like you might be asking for this. This gets the "lower right"
diagonal.
> mat <- matrix(c(1,4,3,4,1,2,3,2,1), nrow = 3, ncol=3, byrow=TRUE)
> mat
[,1] [,2] [,3]
[1,]143
[2,]412
[3,]321
> diag(mat[rev(2:nrow(mat)),-1])
[1] 2 2
>
This gets the uppe
Joe P King wrote:
So many matrices are square symmetrical (i.e. variance-covariance matrices),
is there any way to get R to split the matrix on its diagonal and just
return one diagonal?
mat<-matrix(c(1,4,3,4,1,2,3,2,1), nrow = 3, ncol=3, byrow=TRUE)
is there anyway to get the lower rig
So many matrices are square symmetrical (i.e. variance-covariance matrices),
is there any way to get R to split the matrix on its diagonal and just
return one diagonal?
So if I have
mat<-matrix(c(1,4,3,4,1,2,3,2,1), nrow = 3, ncol=3, byrow=TRUE)
is there anyway to get the lower right di
3 matches
Mail list logo