[R] the number of cluster

2005-03-18 Thread XP Sun
hi, all,

how to decide the number of cluster before you use kmeans and hclust? 
thank you in advance!

best
-xpsun

__
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] how to draw the data set processed by hclust?

2005-03-13 Thread XP Sun
hi, all

   i hava a dataset formated as follow:

x1 y1 z1
x2 y2 z2
x3 y3 z3
... 

how to cluster it with hclust?
and the draw the data with color of cluster?

thank you in advance!

best!
xpsun

__
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] cl$cluster of kmeans

2005-03-07 Thread XP Sun
hi, all,

i had a problem when i used kmeans as follow:

 pp - scan(m0028.data, quiet= TRUE)
 x - matrix(pp, nc=3, byrow=TRUE)
 cl-kmeans(x, 4, 20)
 plot(x, col=cl$cluster)
 save(cl$cluster, file=m0028.ks, ascii=TRUE)
Error in save(cl$cluster, file = m0028.ks, ascii = TRUE) : 
  Object cl$cluster not found

when i wanted to save the vector of cluster only, a reflection was  
thrown out as that. 

could i save cl$cluster only? how?
thank you in advance.

best,
xp sun

__
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] How to use a matrix in pcurve?

2004-10-24 Thread XP Sun
Hi, Everyone,

I want to calculate the principal curve of a points set.
First I read the points'coordinate with function scan, 
then converted it to matrix with the function matrix,
and fit the curve with function principal.curve.

Here is my data in the file bmn007.data: 
0.023603 -0.086540   -0.001533
0.024349 -0.083877   -0.001454
..
..
0.025004 -0.083690   -0.001829
0.025562 -0.083877   -0.001857
0.026100 -0.083877   0.90
0.025965 -0.083877   0.002574

and the code as follow:

pp - scan(bmn007.data, quiet= TRUE)
x - matrix(pp, nc=2, byrow=TRUE)
fit - principal.curve(x, plot = TRUE)
points(fit,col=red)

By now, I got a right result. 
But when i changed to use pcurve with matrix x as pcurve(x),
an error was thrown as following:

Estimating starting configuration using : CA
Error in h %*% diag(sqrt(d)) : non-conformable arguments

How to convert a matrix to the format could be accepted by pcurve?
Any help appreciated!

Regards
- Sun

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html