How to specify other method for dist function in R?

后端 未结 1 1299
长情又很酷
长情又很酷 2021-01-03 04:23

In the documentation for dist function in R there\'s the following words :

method the distance measure to be used. This must be one of \"euclidean\", \"maximum\", \

相关标签:
1条回答
  • 2021-01-03 05:00

    You can't; dist() only knows how to compute certain distances. There are a good number of other distance/dissimilarity coefficients available in R packages via CRAN (including vegan, analogue and the proxy package, amongst many others.)

    The latter, proxy, may be particularly suited to your needs. Not only does it have a large number of pre-specified coefficients, it provides a framework for specifying your own distance function that is then called from compiled code so is reasonably fast.

    0 讨论(0)
提交回复
热议问题