[R] PAM Clustering

Sema Atasever s.atasever at gmail.com
Mon Jul 10 13:17:13 CEST 2017


Dear Authorized Sir / Madam,

I have an R script file in which it includes PAM Clustering codes:

*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?

Thanks in advance.
​
 data.csv
<https://drive.google.com/file/d/0B4rY6f4kvHeCcVpLRTQ5VDhDNUk/view?usp=drive_web>
​

*pam.R*
data <- read.csv2("data.csv")
attach(data)
d=as.matrix(data)
library(cluster)
cluster.pam = pam(d,10)
table(cluster.pam$clustering)

filenameclu = paste("clusters", ".txt")
write.table(cluster.pam$clustering, file=filenameclu,sep=",")

	[[alternative HTML version deleted]]



More information about the R-help mailing list