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

beachcolours

Create Colour Scheme for a Range of Numbers


Description

Given a range of numerical values, this command creates a colour scheme that would be appropriate if the numbers were altitudes (elevation above or below sea level).

Usage

beachcolours(range, sealevel = 0, monochrome = FALSE,
             ncolours = if (monochrome) 16 else 64,
             nbeach = 1)
beachcolourmap(range, ...)

Arguments

range

Range of numerical values to be mapped. A numeric vector of length 2.

sealevel

Value that should be treated as zero. A single number, lying between range[1] and range[2].

monochrome

Logical. If TRUE then a greyscale colour map is constructed.

ncolours

Number of distinct colours to use.

nbeach

Number of colours that will be yellow.

...

Arguments passed to beachcolours.

Details

Given a range of numerical values, these commands create a colour scheme that would be appropriate if the numbers were altitudes (elevation above or below sea level).

Numerical values close to zero are portrayed in green (representing the waterline). Negative values are blue (representing water) and positive values are yellow to red (representing land). At least, these are the colours of land and sea in Western Australia. This colour scheme was proposed by Baddeley et al (2005).

The function beachcolours returns these colours as a character vector, while beachcolourmap returns a colourmap object.

The argument range should be a numeric vector of length 2 giving a range of numerical values.

The argument sealevel specifies the height value that will be treated as zero, and mapped to the colour green. A vector of ncolours colours will be created, of which nbeach colours will be green.

The argument monochrome is included for convenience when preparing publications. If monochrome=TRUE the colour map will be a simple grey scale containing ncolours shades from black to white.

Value

For beachcolours, a character vector of length ncolours specifying colour values. For beachcolourmap, a colour map (object of class "colourmap").

Author(s)

References

Baddeley, A., Turner, R., Moller, J. and Hazelton, M. (2005) Residual analysis for spatial point processes. Journal of the Royal Statistical Society, Series B 67, 617–666.

See Also

Examples

plot(beachcolourmap(c(-2,2)))

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.