Please nevermind as I've just solved this by using scatterplot matrices.
Suhaila

> From: bell_beaut...@hotmail.com
> To: r-help@r-project.org
> Date: Mon, 14 May 2012 06:28:06 +1200
> Subject: [R] Couldn't plot all PCA new attributes on K-Means Clustering
> 
> 
> Hello.
> I'm trying to plot clusters for all possible combination of attributes.
> So I typed in 
> plot(pr2NewMedicalData, col = kmpr2NewMedicalData$cluster)
> The problem is it only plots PC2 axis against PC1 axis. There should be PC1 
> to PC10. I tried it on normal data (not PCA) and it plots all possible 
> combination of attributes.
> Here's the data before applying K-means clustering. It's too long so I just 
> show you some essential information;
> structure(c(8.18794213444232, 108.09939741361, -129.331704413972, 
> 245.596491781615, 284.97336181805, 46.2393277833597, 102.670149102092, 
> ........................................-56.0868873906073, 78.7111917257909, 
> 17.2805919727568, 8.21955994418973, -52.8841201560606), .Dim = c(1076L, 10L), 
> .Dimnames = list(NULL,     c("PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", 
> "PC8",     "PC9", "PC10")))
> And here's the data after applying K-means clustering. It's too long as well 
> so I just show you some essential information only;
> structure(list(cluster = c(2L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 
> 1L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 
> .........................................1L, 1L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 
> 2L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L), 
> centers = structure(c(202.683498408051, -91.234890118988, -6.32822645738145, 
> 2.84855476653021, 7.14162520784024, -3.21469382670974, 9.13147239059093, 
> -4.11039323242235, -2.71400953442991, 1.22167005997248, 2.69685863804327, 
> -1.21394984515696, -1.19187335000922, 0.536503637335695, 0.509142465076951, 
> -0.229182726867495, 4.82054598771028, -2.16989536374021, 4.66753734226828, 
> -2.10102085218006), .Dim = c(2L, 10L), .Dimnames = list(c("1", "2"), c("PC1", 
> "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10"))), totss = 
> 86060500.4826787,     withinss = c(21892651.1737651, 44156468.7023972), 
> tot.withinss = 66049119.8761623,     betweenss = 20011380.6065164, size = 
> c(334L, 742L)), .Names = c("cluster"!
 , !
>  "centers", "totss", "withinss", "tot.withinss", "betweenss", "size"), class 
> = "kmeans")
> Please help,Suhaila                                     
>       [[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
                                          
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to