[BioC] Problem in K- means clustering

Aditya Saxena aditya.235 at gmail.com
Fri Aug 22 18:02:45 CEST 2014


Dear List,

I am working on Affimetrix's HGU133Plus2 chip data GSE23343 from GEO and
want to find the optimal number of clusters.

I am following  http://koti.mbnet.fi/tuimala/oppaat/r2.pdf at pg 113
following code is there but when I tried, I do not find graph but received
following error.

please suggest where I am doing mistake ?

kmax<-c(100)
> if(nrow(dat2)<100) {
+ kmax<-nrow(dat2)
+ }
km<-rep(NA,(kmax-1))
> i<c(2)
while(i<kmax){
+ km[i]<-sum(kmeans(dat2,i,iter.max=20000,nstart=10)$withinss)
+ if(i>=3 & km[i-1]/km[i]<=1.01){
+ i<-kmax
+ } else {
+ i<-i+1
+  }
+ }
>
plot(2:kmax,km,xlab="K",ylab="sum(withinss)",type="b",pch="+",main="Terminated
when change less then 1%")





*Error in plot.window(...) : need finite 'ylim' valuesIn addition: Warning
messages:1: In min(x) : no non-missing arguments to min; returning Inf2: In
max(x) : no non-missing arguments to max; returning -Inf*
Many thanks,

	[[alternative HTML version deleted]]



More information about the Bioconductor mailing list