labcon              package:adehabitat              R Documentation

_L_a_b_e_l_l_i_n_g _C_o_n_n_e_c_t_e_d _F_e_a_t_u_r_e_s

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

     This function attributes unique labels to pixels belonging to
     connected features on a map of class 'asc'.

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

     labcon(x)

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

       x: an object of class 'asc'

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

     Returns a matrix of class 'asc', of type '"factor"', with a number
     of levels equals to the number of connected components

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

     Clment Calenge calenge@biomserv.univ-lyon1.fr

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

     'as.asc'

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

       data(puechabon)
       hr <- getsahrlocs(puechabon$sahr, "hr")
       u <- getkasc(hr, "Jean")
       image(u)

       ## numbering of the connected components
       p <- labcon(u)
       nlevels(p)
       image(p)

       ##  stores the first component
       c1 <- p
       c1[c1 != 1] <- NA
       image(c1)

       ##  stores the second component
       c2 <- p
       c2[c2 != 2] <- NA
       image(c2)

