colasc              package:adehabitat              R Documentation

_C_r_e_a_t_e_s _a _V_e_c_t_o_r _o_f _C_o_l_o_r_s _f_o_r _a _R_a_s_t_e_r _M_a_p _o_f _T_y_p_e '_f_a_c_t_o_r'

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     colasc(x, ...)

_A_r_g_u_m_e_n_t_s:

       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)

_V_a_l_u_e:

     Returns a character vector.

_A_u_t_h_o_r(_s):

     Clment Calenge calenge@biomserv.univ-lyon1.fr

_S_e_e _A_l_s_o:

     'import.asc'

_E_x_a_m_p_l_e_s:

     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)
      

