How do I manipulate/access elements of an instance of “dist” class using core R?

前端 未结 12 2135
傲寒
傲寒 2021-02-02 10:50

A basic/common class in R is called \"dist\", and is a relatively efficient representation of a symmetric distance matrix. Unlike a \"matrix\" object,

12条回答
  •  我在风中等你
    2021-02-02 11:04

    Here's my practical solution for getting values from of a dist object by name. Want to get item 9 as a vector of values?

    as.matrix(mat1)[grepl("9", labels(mat1))]
    

提交回复
热议问题