Learn R Programming

tbart (version 1.0)

tb.raw: Teitz-Bart algorithm applied to a 'raw' distance matrix

Description

Teitz-Bart algorithm applied to a 'raw' distance matrix

Usage

tb.raw(d, guess, verbose = FALSE)

Arguments

d
- A distance matrix (not necessarily Euclidean)
guess
- a guess at the set of p points constituting the $p$-median
verbose
- if TRUE print out each swap in the algorithm (default is FALSE)

Value

Set of point indices for $p$-median (may be local optimum)

Examples

Run this code
x1 <- rnorm(100)
y1 <- rnorm(100)
d <- as.matrix(dist(cbind(x1,y1)))
tb.raw(d,c(1,2))

Run the code above in your browser using DataLab