angles              package:adehabitat              R Documentation

_C_o_m_p_u_t_e _T_u_r_n_i_n_g _A_n_g_l_e_s

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

     'angles' computes the turning angles (in radians) between
     consecutive moves from an object of class 'traj'. See examples for
     a clearer definition.

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

     angles(x, id = levels(x$id), burst = levels(x$burst),
            date = NULL, slsp =  c("remove", "missing"))

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

       x: an object of class 'traj' 

      id: a character vector giving the identity of the animals for
          which the angles are to be computed

   burst: a character vector giving the identity of the circuits for
          which the angles are to be computed (see 'as.traj')

    date: a vector of class 'POSIXct' of length 2 (beginning, end)
          delimiting the period of interest

    slsp: a character string.  If '"remove"', successive relocations
          located at the same place are replaced by a single
          relocation, allowing the computation of the angles.  If
          '"missing"', a missing value is returned for the angles when
          successive relocations located at the same place. 

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

     Returns a data frame with the following components: 

      id: the identity of the animal

       x: the x coordinate of the relocation at which the angle is
          computed

       y: the y coordinate of the relocation at which the angle is
          computed

    date: a vector of class 'POSIXct', giving the date at which the
          relocation has been taken

   burst: the id of the circuit (see 'help(as.traj)')

  angles: the turning angles between the successive moves.

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

     Clment Calenge calenge@biomserv.univ-lyon1.fr

_R_e_f_e_r_e_n_c_e_s:

     Turchin, P. (1998) _Quantitative analysis of movement. Measuring
     and modeling population redistribution in animals and plants._
     Sunderland, Massachusetts: Sinauer Associates.

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

     'speed' for computation of movement speeds, 'as.traj' for
     additional information about objects of class 'traj'

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

     ## loads an object of class "traj"
     data(puechcirc)
     puechcirc

     ## Gets a part of the trajectory of the wild boar named
     ## CH93 and draws it
     ## Also displays the turning angles
     toto <- puechcirc[2:5,]
     plot(toto$x, toto$y, asp = 1, ylim = c(3158300, 3158550),
          pch = 16,
          main = "Turning angles between\nthree consecutive moves",
          xlab="X", ylab="Y")
     lines(toto$x, toto$y)
     lines(c(toto$x[2], 700217.6),
           c(toto$y[2], 3158310), lty=2)
     lines(c(toto$x[3],700289),
           c(toto$y[3],3158546), lty=2)
     ang1x <- c(700234.8, 700231.9, 700231, 700233.7, 700238.8, 700243.2)
     ang1y <- c(3158332, 3158336, 3158341, 3158347, 3158350, 3158350)
     ang2x <- c(700283.3, 700278.8, 700275.4, 700272.4, 700271.2, 700271.6,
                700274.7)
     ang2y <- c(3158522, 3158522, 3158520, 3158517, 3158514, 3158508, 3158504)
     lines(ang1x, ang1y)
     lines(ang2x, ang2y)
     text(700216.1, 3158349, expression(theta[1]), cex=2)
     text(700247.7, 3158531, expression(theta[2]), cex=2)
     text(c(700301, 700231), c(3158399, 3158487),
          c("Beginning", "End"), pos=4)


     ## Computation of the turning angles with real data
     ## on wild boars
     plot(puechcirc)
     ang <- angles(puechcirc)

     ## The angles are in the column Angles:
     ang[1:4,]

