[R] k-means clustering

2007-03-19 Thread Sergio Della Franca
Dear R-helpers, I'm trying to perform k-means clustering. For example, I have this dataset(y): AGE PRODUCTS SEX 92 3253 M 43 4144 F 67 3246 M 22 4144 F 56 4087 F 89 3836

Re: [R] k-means clustering

2007-03-19 Thread Ranjan Maitra
kmeans(y[,c(AGE, PRODUCTS)], 3) should do what I think you want. Note that you should try several starting points for good optimality of the partitioning. HTH, Ranjan On Mon, 19 Mar 2007 20:12:10 +0100 Sergio Della Franca [EMAIL PROTECTED] wrote: Dear R-helpers, I'm trying to perform