Displaying 1 result from an estimated 1 matches for "landmat_vec".
2012 Sep 13
1
problem creating an array
...scape combinations are
#created; each set of 3 columns should sum to one
landmat=cbind(mat[,c(1)],mat[,c(202)],mat[,c(403)])
for (i in 2:201)
{
landmat=cbind(landmat,(cbind(mat[,c(i)],mat[,c(i+201)],mat[,c(i+402)])))
}
##this loop is a check to ensure the triplets all sum to 1
#sum=numeric()
#n=1
#landmat_vec=landmat[1,]
#for (i in 1:201)
#{
#sum[i]=landmat_vec[n]+landmat_vec[n+1]+landmat_vec[n+2]
#n=n+3
#}
#create vector of column names in "hab" for each matrix and attach using
#"colnames(matrix)"
hab<-c("theta1","theta2","theta3")
colnames(landmat...