Re: [R] Clustering and functions

From: Sarah Goslee <sarah.goslee_at_gmail.com>
Date: Sat, 08 Nov 2008 10:53:27 -0500

It would help a lot if you told us what the error message was, and provided some data to work with. As it is, we can't even run the function to find out what goes wrong.

And also, OS, version of R - all that stuff that the posting guide requests.

Sarah

On Sat, Nov 8, 2008 at 10:31 AM, Bryan Richardson <richarbb_at_email.uc.edu> wrote:
> I am new to R and have written a function that clusters on subsets of a big data data set with 60,000 points. I am not sure why, but I keep getting a run-time error. Any suggestions would be greatly appreciated.
>
> Here is the code:
>
> library(cba)
>
> d<-read.csv("data.csv", header=TRUE)
>
> v<-c(53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,21,72 73,74,75,76,77,78)
>
> clusterMe<-function(d,v){
> tempMat<-subset(d,d[,v[1]]=="TRUE")
> rc<-rockCluster(tempMat,n=5,theta=.2)
> tempMat<-cbind(tempMat,rc$cl)
> M<-tempMat
> for (i in 2:26){
> tempMat<-subset(d,d[,v[i]]=="TRUE")
> rc<-rockCluster(tempMat,n=5,theta=.2)
> tempMat<-cbind(tempMat,rc$cl)
> M<-rbind(M,tempMat)
> }
> M
> }
>
> clusters<-clusterMe(d,v)
>
> Bryan

-- 
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
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 Sat 08 Nov 2008 - 15:55:28 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 Sat 08 Nov 2008 - 16: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