distancetotrap             package:secr             R Documentation

_D_i_s_t_a_n_c_e _T_o _N_e_a_r_e_s_t _D_e_t_e_c_t_o_r

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

     Compute distance from each of a set of points to the nearest
     detector in an array, or return the sequence number of the
     detector nearest each point.

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

     distancetotrap(X, traps)

     nearesttrap(X, traps)

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

       X: coordinates 

   traps: traps object 

_D_e_t_a_i_l_s:

     'distancetotrap' returns the distance from each point in X to the
     nearest detector in 'traps'. It may be used to restrict the points
     on a habitat mask.

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

     'distancetotrap' returns a vector of distances (assumed to be in
     metres). 

     'nearesttrap' returns the index of the nearest trap.

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

     Murray Efford murray.efford@otago.ac.nz

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

     'make.mask'

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

       ## restrict a habitat mask to points within 70 m of traps  
       ## this is nearly equivalent to using make.mask with the 
       ## 'trapbuffer' option
       temptrap <- make.grid()
       tempmask <- make.mask(temptrap)
       d <- distancetotrap(tempmask, temptrap)
       tempmask <- subset(tempmask, d < 70)

