Description Usage Arguments Details Value Examples
Extract distances as a vector when product is inner and as a matrix when the product is outer
1 | dist_extract(object, i, j, product = "inner")
|
object |
distance object |
i |
index |
j |
index. If missing, this defaults to 1:size of the dist object |
product |
(string) product type. One among: 'inner', 'outer'. |
When j is missing, it defaults to 1:size of the dist object. When the product is inner and lengths of i and j mismatch, the smaller one is extended to the size of the onger one.
A vector of distances when 'inner' is used. A matrix of distances when 'outer' is used.
1 2 3 | temp <- stats::dist(datasets::mtcars)
dist_extract(temp, 1:2, 3:5, "inner")
dist_extract(temp, 1:2, 3:5, "outer")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.