R: Draw a color-coded triangular distance matrix

distogram {squash} | R Documentation

## 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`).

### Details

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

### Value

The color map, invisibly.

### See Also

`corrogram`

### Examples

      ## 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)

[Package squash version 1.0.8 Index]