Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

colouroutputs

Extract or Assign Colour Values in a Colour Map


Description

Extract the colour values in a colour map, or assign new colour values.

Usage

colouroutputs(x)

colouroutputs(x) <- value

Arguments

x

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

value

A vector of values that can be interpreted as colours.

Details

An object of class "colourmap" is effectively a function that maps its inputs (numbers or factor levels) to colour values.

The command colouroutputs(x) extracts the colour values in the colour map x.

The assignment colouroutputs(x) <- value replaces the colour values in the colour map x by the entries in value. The replacement vector value should have the same length as colouroutputs(x), and its entries should be interpretable as colours.

To change only some of the colour values in a colour map, it may be easier to use tweak.colourmap.

Value

The result of colouroutputs is a character vector of colour values. The result of the assignment colouroutputs(x) <- value is another colour map (object of class "colourmap").

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.

See Also

Examples

m <- colourmap(rainbow(5), range=c(0,1))
  m
  # reverse order of colours
  colouroutputs(m) <- rev(colouroutputs(m))
  m

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.