[R] kmeans clustering

richard mendes mendes.richard at gmail.com
Thu Jun 29 11:23:17 CEST 2006

Hello R list members,

I'm a bio informatics student from the Leiden university
(netherlands). We were asked to make a program with different
clustering methods. The problem we are experiencing is the following.

we have a matrix with data like the following

                 research1    research2    research3    enz
sample1      0.5             0.2              0.4

sample2      0.4             0.4              0.3

sample3      0.7             0.2              0.8


now if we use kmeans(matrix,3,20) the clustering method will cluster
only on rows by using the columns values as multiple variables. The
output from this syntax is for example

sample1 = 1
sample2 = 2
sample3 = 3

Is there a method that will use the rows and columns as seperate
values so that every variable in the matrix will be assigned to a
cluster instead of a row.

the output then could be interperted as a heatmap.

thank you in advance for your time,

Richard Mendes

More information about the R-help mailing list