specgroups | R Documentation |
Generates average within-group distances (overall and group-wise) from a dissimilarity matrix and a given grouping.
specgroups(distmat,groupvector, groupinfo)
distmat |
dissimilarity matrix or |
groupvector |
integer vector. For every row of |
groupinfo |
list with components |
A list with parameters
overall |
overall average within-groups dissimilarity. |
gr |
vector of group-wise average within-group dissimilarities
(this will be |
Christian Hennig christian.hennig@unibo.it https://www.unibo.it/sitoweb/christian.hennig/en
options(digits=4)
data(siskiyou)
x <- prabinit(prabmatrix=siskiyou, neighborhood=siskiyou.nb,
distance="logkulczynski")
groupvector <- as.factor(siskiyou.groups)
ng <- length(levels(groupvector))
lg <- levels(groupvector)
nsg <- numeric(0)
for (i in 1:ng) nsg[i] <- sum(groupvector==lg[i])
groupinfo <- list(lg=lg,ng=ng,nsg=nsg)
specgroups(x$distmat,groupvector,groupinfo)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.