flip                  package:secr                  R Documentation

_F_l_i_p _P_o_i_n_t_s

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

     Flip an array of points about a vertical or horizontal axis.

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

     flip (object, lr = F, tb = F, ...)

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

  object: a 2-column matrix or object that can be coerced to a matrix 

      lr: either logical for whether array should be flipped
          left-right, or numeric value for x-coordinate of axis about
          which it should be flipped left-right 

      tb: either logical for whether array should be flipped
          top-bottom, or numeric value for y-coordinate of axis about
          which it should be flipped top-bottom 

     ...: other arguments (not used) 

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

     Logical values for 'lr' or 'tb' indicate that points should be
     flipped about the mean on the relevant axis. 

     Numeric values indicate the particular axis value(s) about which
     points should be flipped.  The default arguments result in no
     change.

     This is a generic function. A method is provided for 'traps'
     objects.

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

     A matrix with the coordinates of each point reflected about the
     desired axis or axes.

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

     Murray Efford murray.efford@otago.ac.nz

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

     'traps', 'rotate.traps'

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

     temp <- matrix(runif (20) * 2 - 1, nc = 2)
     temp2 <- flip(temp, lr = 1)
     plot(temp, xlim=c(-1.5,4), ylim = c(-1.5,1.5), pch = 16)
     points (temp2, pch = 1)
     arrows (temp[,1], temp[,2], temp2[,1], temp2[,2], length = 0.1) 

