dist_groups: Create a data frame of distances between groups of items.

Description Usage Arguments Value Examples

View source: R/dist.R

Description

Create a data frame of distances between groups of items.

Usage

1

Arguments

d

A distance matrix object of class dist.

g

A factor representing the groups of objects in d.

Value

A data frame with 6 columns:

Item1, Item2

The items being compared.

Group1, Group2

The groups to which the items belong.

Label

A convenient label for plotting or comparison.

Distance

The distance between Item1 and Item2.

Examples

1
2
3
4
m4 <- matrix(1:16, nrow=4, dimnames=list(LETTERS[1:4]))
dm4 <- dist(m4)
g4 <- rep(c("Control", "Treatment"), each=2)
dist_groups(dm4, g4)

kylebittinger/usedist documentation built on Oct. 24, 2021, 12:43 p.m.