as.colourmap: Convert to Colour Map

View source: R/colourtables.R

as.colourmapR Documentation

Convert to Colour Map

Description

Convert some other kind of data to a colour map.

Usage

  as.colourmap(x, ...)

  ## S3 method for class 'colourmap'
as.colourmap(x, ...)

  ## S3 method for class 'symbolmap'
as.colourmap(x, ..., warn=TRUE)

Arguments

x

Data to be converted to a colour map. An object of class "symbolmap", "colourmap" or some other kind of suitable data.

...

Other arguments passed to methods.

warn

Logical value specifying whether to issue a warning if x does not contain any colour map information.

Details

If x contains colour map information, it will be extracted and returned as a colour map object. Otherwise, NULL will be returned (and a warning will be issued if warn=TRUE, the default).

Value

A colour map (object of class "colourmap") or NULL.

Author(s)

\spatstatAuthors

.

See Also

colourmap

Examples

  m <- pHcolourmap(c(3,8))
  g <- symbolmap(pch=21, bg=m, size=function(x){ 1.1 * x }, range=c(3,8))
  opa <- par(mfrow=c(1,2))
  plot(g, vertical=TRUE)
  plot(as.colourmap(g), vertical=TRUE)
  par(opa)

spatstat.geom documentation built on May 29, 2024, 4:09 a.m.