dist_groups {usedist}R Documentation

Create a data frame of distances between groups of items.

Description

Create a data frame of distances between groups of items.

Usage

dist_groups(d, g)

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

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)

[Package usedist version 0.4.0 Index]