convnum              package:adehabitat              R Documentation

_C_o_n_v_e_r_s_i_o_n _f_r_o_m _F_a_c_t_o_r _t_o _N_u_m_e_r_i_c _f_o_r _R_a_s_t_e_r _M_a_p

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

     The objects of class 'kasc' may contain maps of type '"numeric"'
     (e.g. the elevation) or of type '"factor"' (e.g. the type of
     vegetation).  'convnum' centres and scales the maps of type
     '"numeric"', and factor maps are transformed into a collection of
     k maps of type '"numeric"' (where k is the number of levels of the
     factor), with zero means and unit variance (see 'dudi.mix' in the
     'ade4' package for further details).

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

     convnum(kasc)

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

    kasc: an object of class 'kasc'

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

     Returns a list with the following components: 

    kasc: an object of class 'kasc'

  weight: the weights associated with each map of the object kasc, so
          that the collection of maps defining a categorical variable
          has the same weight that a numeric variable (see examples).

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

     Clment Calenge calenge@biomserv.univ-lyon1.fr

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

     'dudi.mix', 'as.kasc'

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

     ## loads the data
     data(puechabon)
     kasc <- puechabon$kasc
     image(kasc)

     ## scales all the variables
     toto <- convnum(kasc)
     image(toto$kasc)

     ## the Aspect has four levels:
     ## four variables have been defined.
     toto$weight

     ## The sum of the weights given to each
     ## level of aspect is equal to:
     toto$weight[2:5]
     sum(toto$weight[2:5])

     ## The same weight is therefore given to the factor variable Aspect and
     ## to any continuous variable, e.g. the elevation.

