squash (version 1.0.8)

distogram: Draw a color-coded triangular distance matrix

Description

This function draws a color-coded, rotated triangular matrix indicating the "distance" between every pair of items.

Usage

distogram(x, map, 
  n = 10, base = NA, colFn = heat, 
  key = TRUE,  title = NA, ...)

Arguments

x

A dist object, or a square numeric matrix.

map

A color map, as generated by makecmap (optional).

n, base, colFn

Arguments passed to makecmap, if map is omitted.

key

Add a color key?

title

Title for the color key.

Further arguments passed to trianglegram, (e.g. labels).

Value

The color map, invisibly.

Details

If the input x is a matrix, the lower triangle is extracted by default (but see the arguments for trianglegram).

See Also

corrogram

Examples

Run this code
# NOT RUN {
  ## Distances between European cities
  distogram(eurodist, title = 'Distance (km)')  

  ## Some variations
  map <- distogram(eurodist, key = FALSE, colFn = jet, right = TRUE)  
  vkey(map, title = 'Distance (km)', x = -8)

# }

Run the code above in your browser using DataLab