[R] Partition data into clusters

From: Suhaila Zainudin <suhaila.zainudin_at_gmail.com>
Date: Tue, 18 Mar 2008 01:12:16 -0700


Greetings R-users,

I have been using the fpc package in R to cluster my data. Speficically I am using kmeansruns clustering.
I would like to know how I use R to partition data into clusters. What I am doing is as follows.

# Use csv file as input
#####################

wholeset = read.csv("Spellman800genesImputed.csv")

# exclude first col (gene names)
##########################

wholeset2 = wholeset[,-1]

#Use fpc
###########################

library(fpc)

cl.kmr10 <- kmeansruns(wholeset2,k=10,runs=10)

#append cluster label to original dataset
###################

cl2 <- data.frame(wholeset, cl.kmr10$cluster)

After this step, I write cl2 into a csv file and manually partition data into its respective clusters using Excel. Then I read the data from each clusters back into R for further analysis.

Can I do the data partitioning directly in R?

TQ

-- 
Suhaila Zainudin
PhD Candidate
Universiti Teknologi Malaysia

	[[alternative HTML version deleted]]

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 18 Mar 2008 - 08:14:53 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 19 Mar 2008 - 14:30:23 GMT.

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

list of date sections of archive