legendTable: Table for colour scales

View source: R/legendTable.R

legendTableR Documentation

Table for colour scales

Description

A table in html or Latex showing values associated with colours

Usage

legendTable(x,
    type=c('latex',  'html'),
    box = c(-0.2, 1, 2),
    unit = 'em',
    collapse=NULL)

Arguments

x

a data.frame with columns col and label, possibly produced by colourScale

type

html or latex compatible output

box

dimensions of colour boxes, passed as depth, height and width to rule in Latex, or width (first two elements ignored) for html.

unit

Units for box dimensions

collapse

If non-NULL, passed to paste to produce a character vector instead of table

Value

data.frame or character vector

See Also

colourScale

Examples


mytable = data.frame(col=col2html(1:5), label=1:5)

legendTable(mytable)
legendTable(mytable, collapse=';')
legendTable(mytable, type='html')


mapmisc documentation built on Nov. 21, 2023, 5:09 p.m.