Learn R Programming

fisheyeR (version 0.9)

query2Cols: 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.

See Also

POIPlot-methods,POI-class,plotPOI

Examples

Run this code
   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)

Run the code above in your browser using DataLab