Displaying 1 result from an estimated 1 matches for "xclu".
Did you mean:
clu
2001 Aug 21
4
looking for a smarter way
...ance on five different columns for each of 14 clusters and
get them into one matrix. I get the job done, but I would have thought that
it could be done in one or two lines, not six, and be generalized so that it
didn't matter how many columns I had. Any suggestions?
xtap1<-tapply(xcmd[,1],xclu$clustering,var)
xtap2<-tapply(xcmd[,2],xclu$clustering,var)
xtap3<-tapply(xcmd[,3],xclu$clustering,var)
xtap4<-tapply(xcmd[,4],xclu$clustering,var)
xtap5<-tapply(xcmd[,5],xclu$clustering,var)
xtap<-cbind(xtap1,xtap2,xtap3,xtap4,xtap5)
The next example is somewhat similar, but I'...