Last data update: 2014.03.03
|
R: Create color vector for elements in an object of class POI
query2Cols | R Documentation |
Create color vector for elements in an object of class POI
Description
query2Cols assigns a color to every element in the POI, accordingly with its cos.query.docs value.
Valid palettes: 'heat', 'topo', 'cm' and 'terrain'.
Note that cos.query.docs value must be in the range [0-1].
Usage
query2Cols(object, value)
Arguments
object |
object of class POI
|
value |
Palette to apply. One in: 'heat','topo','cm','terrain'
|
Value
A vector with corresponding color to each element of POI.
Author(s)
Eduardo San Miguel Martin
See Also
POIPlot-methods ,POI-class ,plotPOI
Examples
data(USArrests)
usaPOI = POICreate('POI')
usaPOI@cos.query.docs <- USArrests[,3] / max(USArrests[,3]) # urban population (1 high - 0 low)
usaPOI@colores <- query2Cols(usaPOI, 'terrain')
plot(usaPOI@cos.query.docs, col = usaPOI@colores)
usaPOI@colores <- query2Cols(usaPOI, 'heat')
plot(usaPOI@cos.query.docs, col = usaPOI@colores)
Results
|