Re: [R] Until the key pressed: FOR-LOOP-Clustering

From: Liaw, Andy <andy_liaw_at_merck.com>
Date: Thu 11 May 2006 - 03:41:58 EST


Not sure exactly what you're asking, but I'll take a stab at it: Try adding par(ask=TRUE) before the for() loop.

Andy

From: j.joshua thomas
>
> Hi All,
>
> These are the code that i used to plot the kmeans clustering.
>
> DataSetS01022<-rbind(matrix(rnorm(50),ncol=2),
> + matrix(rnorm(50),ncol=2))
> > colnames(DataSetS01022) <-c("timeslot","em") (cl
> ><-kmeans(DataSetS01022,2)) plot (DataSetS01022, col=cl$cluster)
> >points(cl$centers, col = 1:2, pch = 8, cex=2)
>
> Now, i would like to do *the same process for 5 times*, so
> that i can view the clusters in data have been moving and the
> center changes with various results.
> (Animation-like)
>
> My main concern here, is how to put this in a *loop form* or
> any other methods are available?
>
> I tried with:* clarax$clusinfo I thought of doing it to
> activate Device (1) & (2)*
> **
> *Really need anyones help!*
> **
> *JJ*
> *---*
>
>
>
> --
> Lecturer J. Joshua Thomas
> KDU College Penang Campus
> Research Student,
> University Sains Malaysia
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu May 11 03:46:41 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 11 May 2006 - 04:10:04 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.