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

trellis.factor.key

Color coding legend for factors Modifies a list of lattice arguments (as for levelplot, etc.) according to the factor levels. The colorkey will shows all levels (including unused), and the drawing colors will be set accordingly.


Description

trellis.factor.key is used during levelplot-based plotting of factors (for hyperSpec objects) unless transform.factor = FALSE is specified.

Usage

trellis.factor.key(f, levelplot.args = list())

Arguments

f

the factor that will be color-coded

levelplot.args

a list with levelplot arguments

Value

the modified list with levelplot arguments.

Author(s)

C. Beleites

See Also

Examples

chondro$z <- factor (rep (c("a", "a", "d", "c"),
                          length.out = nrow (chondro)),
                     levels = letters [1 : 4])

str (trellis.factor.key (chondro$z))

plotmap (chondro, z ~ x * y)

## switch off using trellis.factor.key:
## note that the factor levels are collapsed to c(1, 2, 3) rather than
## c (1, 3, 4)
plotmap (chondro, z ~ x * y, transform.factor = FALSE)

plotmap (chondro, z ~ x * y,
         col.regions = c ("gray", "red", "blue", "dark green"))

hyperSpec

Work with Hyperspectral Data, i.e. Spectra + Meta Information (Spatial, Time, Concentration, ...)

v0.100.0
GPL (>= 3)
Authors
Claudia Beleites [aut, cre, dtc] (<https://orcid.org/0000-0003-1626-154X>), Valter Sergo [aut], Alois Bonifacio [ctb, dtc], Marcel Dahms [ctb], Björn Egert [ctb], Simon Fuller [ctb], Vilmantas Gegzna [ctb], Rustam Guliev [ctb], Bryan A. Hanson [ctb], Michael Hermes [ctb], Martin Kammer [dtc], Roman Kiselev [ctb], Sebastian Mellor [ctb]
Initial release
2021-09-13

We don't support your browser anymore

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