rlabel               package:spatstat               R Documentation

_R_a_n_d_o_m _R_e-_L_a_b_e_l_l_i_n_g _o_f _P_o_i_n_t _P_a_t_t_e_r_n

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

     Randomly allocates marks to a point pattern, or permutes the
     existing marks, or resamples from the existing marks.

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

        rlabel(X, labels=X$marks, permute=TRUE)

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

       X: Point pattern (object of class '"ppp"'). 

  labels: Vector of values from which the new marks will be drawn at
          random. Defaults to the vector of existing marks. 

 permute: Logical value indicating whether to generate new marks by
          randomly permuting 'labels' or by drawing a random sample
          with replacement. 

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

     This very simple function allocates random marks to an existing
     point pattern 'X'. It is useful for hypothesis testing purposes.

     In the simplest case, the command 'rlabel(X)' yields a point
     pattern obtained from 'X' by randomly permuting the marks of the
     points.

     If 'permute=TRUE', then 'labels' should be a vector of length
     equal to the number of points in 'X'. The result of 'rlabel' will
     be a point pattern with locations given by 'X' and marks given by
     a random permutation of 'labels' (i.e. a random sample without
     replacement).

     If 'permute=FALSE', then 'labels' may be a vector of any length. 
     The result of 'rlabel' will be a point pattern with locations
     given by 'X' and marks given by a random sample from 'labels'
     (with replacement).

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

     A marked point pattern.

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

     Adrian Baddeley adrian@maths.uwa.edu.au <URL:
     http://www.maths.uwa.edu.au/~adrian/> and Rolf Turner
     rolf@math.unb.ca <URL: http://www.math.unb.ca/~rolf>

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

     'setmarks' to assign arbitrary marks.

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

        data(amacrine)

        # Randomly permute the marks "on" and "off"
        # Result always has 142 "off" and 152 "on"
        Y <- rlabel(amacrine)

        # randomly allocate marks "on" and "off"
        # with probabilities p(off) = 0.48, p(on) = 0.52
        Y <- rlabel(amacrine, permute=FALSE)

        # randomly allocate marks "A" and "B" with equal probability
        data(cells)
        Y <- rlabel(cells, labels=factor(c("A", "B")), permute=FALSE)

