Skip to content

Extracting coordinates for cluster::clusplot()

2 messages · Michael Kubovy, Mark Difford

#
They are not made available. You can get them as follows:

x <- rbind(cbind(rnorm(10, 0, 0.5), rnorm(10, 0, 0.5)),  
cbind(rnorm(15, 5, 0.5), rnorm(15, 5, 0.5)))
pp <- pam(x, 2)

## The coordinates are in obj$scores
princomp(pp$data, scores = TRUE, cor = ncol(pp$data) != 2)$scores
plot(princomp(pp$data, scores = TRUE, cor = ncol(pp$data) != 2)$scores)

I have not set the y-scaling to match to output from plot(pp, which = 1),
but you can set it for yourself to see that they are the same. Or you can
debug "clusplot()" for yourself.

Mark Difford.
Michael Kubovy wrote: