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           M
  47          4379           M

My situation is the following:
- If i use this code: cluster<-kmeans(y,3), the program doesn't run because
the variable "SEX" isn't numeric.
- If i use this code: cluster<-kmeans(y[,{"AGE"}],3), the program run
correctly.
- If i use this code: cluster<-kmeans(y[,{"AGE" ; "PRODUCTS"}],3), the
program run correctly, but the k-means clustering is performed only on the
variable "PRODUCTS".

I would like to perform the k-means clustering on the two numeric variable i
have.
How can i modify the k-means code to develop the clustering on numeric
variable that i decide to use?


Thank you in advance.

Sergio Della Franca.

	[[alternative HTML version deleted]]

