[R] PAM Clustering

Germano Rossi germano.rossi at gmail.com
Thu Aug 17 13:58:48 CEST 2017


try this

MYdata <- read.csv2("data.txt",dec='.')
library(cluster)
cluster.pam = pam(MYdata,10)
table(cluster.pam$clustering)
filenameclu = paste("clusters", ".txt")
write.table(cluster.pam$clustering, file=filenameclu,sep=",")


2017-08-17 10:28 GMT+02:00 Sema Atasever <s.atasever a gmail.com>:

> Dear Authorized Sir / Madam,
>
> I have a data set in which each row indicates an amino asid and each
> column corresponds
> to a feature (in total 539 features).
> I want to use PAM Clustering usign this data set.
>
>
> *when i ran R script i am getting this error:*
> *Error in pam(d, 10) : x is not a numeric dataframe or matrix.*
> *Execution halted*
>
> How can i fix this error? Is there a problem with my dataset?
>
> Thanks in advance.
>
>
> *PAM clustering codes:*
>
> MYdata <- read.csv2("data.txt", dec = ".")
> attach(MYdata)
> d=as.matrix(MYdata)
> library(cluster)
> cluster.pam = pam(d,10)
> table(cluster.pam$clustering)
>
> filenameclu = paste("clusters", ".txt")
> write.table(cluster.pam$clustering, file=filenameclu,sep=",")
>
> ______________________________________________
> R-help a r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>



-- 
==================
Germano Rossi, Dipartimento di Psicologia, Universita' degli Studi di
Milano Bicocca
Piazza dell'Ateneo Nuovo, 1- 20126 Milano - Italy

	[[alternative HTML version deleted]]



More information about the R-help mailing list