dist_setNames: Set the names/labels of a 'dist' object.

Description Usage Arguments Value Examples

Description

Set the names/labels of a dist object.

Usage

1

Arguments

d

A distance matrix object of class dist.

nm

New labels for the rows/columns.

Value

A distance matrix with new row/column labels.

Examples

1
2
3
m4 <- matrix(1:16, nrow=4, dimnames=list(LETTERS[1:4]))
dm4 <- dist(m4)
dist_setNames(dm4, LETTERS[9:12])

Example output

  I J K
J 2    
K 4 2  
L 6 4 2

usedist documentation built on March 2, 2020, 1:07 a.m.