You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use a modified version of this function and thought I'd share w/ others in case it's ever helpful. Originally, the code within the if block that checks if add.center.points is true, requires the plyr library. I don't usually have that library installed so I've modified the snipped to use do.call instead.
clustergram.plot.matlines <- function(X, Y, k.range,
x.range, y.range, COL,
add.center.points, centers.points) {
plot(
0,
0,
col = "white",
xlim = x.range,
ylim = y.range,
axes = F,
xlab = "Number of clusters (k)",
ylab = "PCA weighted Mean of the clusters",
main = c("Clustergram of the PCA-weighted Mean of", "the clusters k-mean clusters vs number of clusters (k)")
)
axis(side = 1, at = k.range)
axis(side = 2)
abline(v = k.range, col = "grey")
matlines(t(X), t(Y), pch = 19, col = COL, lty = 1, lwd = 1.5)
if (add.center.points) {
xx <- do.call(rbind, centers.points)
points(xx$y ~ xx$x, pch = 19, col = "red", cex = 1.3)
}
The text was updated successfully, but these errors were encountered:
I use a modified version of this function and thought I'd share w/ others in case it's ever helpful. Originally, the code within the if block that checks if add.center.points is true, requires the plyr library. I don't usually have that library installed so I've modified the snipped to use do.call instead.
The text was updated successfully, but these errors were encountered: