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

Description Usage Arguments Value Examples

Description

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

Usage

1
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

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

Example output

Loading required package: Rcpp
Loading required package: sp
[1] 67 73

tbart documentation built on May 2, 2019, 2:49 p.m.