I'm using R to perform an hierarchical clustering. As a first approach I used hclust
and performed the following steps:
- I imported the distance matrix
- I used the
as.dist
function to transform it in adist
object - I run
hclust
on thedist
object
Here's the R code:
distm <- read.csv("distMatrix.csv")
d <- as.dist(distm)
hclust(d, "ward")
At this point I would like to do something similar with the function pvclust
; however, I cannot because it's not possible to pass a precomputed dist
object. How can I proceed considering that I'm using a distance not available among those provided by the dist
function of R?