[R] PAM Clustering

Sema Atasever s.atasever at gmail.com
Thu Aug 17 16:03:15 CEST 2017


Dear Germano,

Thank you for your fast reply,

In the above code, *MYData *is the actual data set.

Do not we need to convert *MYData to *the dissimilarity matrix using
*pam(as.dist(**MYData**), k = 10, diss = TRUE*)*   code line?*

*Regards.*

On Thu, Aug 17, 2017 at 2:58 PM, Germano Rossi <germano.rossi at gmail.com>
wrote:

> 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 at 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 at 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/posti
>> ng-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