colasc: Creates a Vector of Colors for a Raster Map of Type 'factor'

Description Usage Arguments Value Author(s) See Also Examples

Description

colasc creates a vector of colors for a raster map of class asc and of type "factor".

Usage

1
colasc(x, ...)

Arguments

x

an object of class asc.

...

arguments named as the levels of the factor, with character values equal to the colors for these levels (see examples)

Value

Returns a character vector.

Author(s)

Clement Calenge clement.calenge@oncfs.gouv.fr

See Also

asc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(puechabon)

## gets the aspect in an asc object
asp <- getkasc(puechabon$kasc, "Aspect")

## creates the vector of colors
cl <- colasc(asp, NorthEast = "blue", SouthEast = "red", 
             SouthWest = "orange", NorthWest = "green")

## graphical display
image(asp, clfac = cl, main = "Aspect", xlab = "Lambert X",
      ylab = "Lambert Y")
legend(706500, 3162000, legend=levels(asp), fill = cl, cex = 0.7)
 

adehabitat documentation built on Jan. 28, 2018, 5:02 p.m.