# NOT RUN {
set.seed(20000)
options(digits=3)
face <- rFace(10,dMoNo=2,dNoEy=0,p=2)
dif <- dist(face)
clusum <- list()
clusum[[2]] <- list()
cl12 <- kmeansCBI(face,2)
cl13 <- kmeansCBI(face,3)
cl22 <- claraCBI(face,2)
cl23 <- claraCBI(face,2)
ccl12 <- clustatsum(dif,cl12$partition)
ccl13 <- clustatsum(dif,cl13$partition)
ccl22 <- clustatsum(dif,cl22$partition)
ccl23 <- clustatsum(dif,cl23$partition)
clusum[[1]] <- list()
clusum[[1]][[2]] <- ccl12
clusum[[1]][[3]] <- ccl13
clusum[[2]][[2]] <- ccl22
clusum[[2]][[3]] <- ccl23
clusum$maxG <- 3
clusum$minG <- 2
clusum$method <- c("kmeansCBI","claraCBI")
clusum$name <- c("kmeansCBI","claraCBI")
clusim <- randomclustersim(dist(face),G=2:3,nnruns=2,kmruns=2,monitor=FALSE)
cgr <- cgrestandard(clusum,clusim,2:3)
cgr2 <- cgrestandard(clusum,clusim,2:3,useallg=TRUE)
cgr3 <- cgrestandard(clusum,clusim,2:3,percentage=TRUE)
print(str(cgr))
print(str(cgr2))
print(str(cgr3))
# }
Run the code above in your browser using DataLab