Format For Distance Matrix For Running Hclust On R
Hi
I am using R for a simple hierarchical clustering method for finding protein sequence similarities. I already have a distance matrix computed. I am using hclust method to run it. (Thus I dont want to use dist method). Could anyone tell me what format does my distance matrix need to be for hclust to run?
I used the read.xls method to read my excel file. I need only the lower triangular portion of the matrix. And this I am sending to hclust to be clustered.
d= as.matrix(mat)
hc =hclust(d, method="single")
How ever this is the error i get:
Error in if (n < 2) stop("must have n >= 2 objects to cluster") :
argument is of length zero
Am I doing this right?
Could anyone please help me out?
Thanks
• 3,898 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Closed as exact duplicate. I hope that you did not create a 2nd account, just to ask this question again.
Sorry, exact duplicate of which question? It could be useful if you also include the link..
I imagine Biostars used to show the link to the duplicate, 5.7 years ago, as Stack Exchange sites do.
This is the same person. Please don't ask the same question again under different names. That's not the way to get what you want.