setmarks              package:spatstat              R Documentation

_S_e_t _o_r _R_e_s_e_t _t_h_e _M_a_r_k_s _i_n _a _P_o_i_n_t _P_a_t_t_e_r_n

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

     Create a marked point pattern from given point locations and given
     marks.

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

       setmarks(X, m)
       X %mark% m

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

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

       m: Vector of mark values (of any atomic mode) 

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

     This function is a shortcut which creates a marked point pattern
     from a given point pattern 'X' and a given vector 'm'  by
     attaching the marks in 'm' to the locations of the points in 'X'.

     If 'X' is already a marked point pattern, then its marks are
     ignored and replaced by the values in 'm'.

     If 'm' is a single value, then all points will be given this mark
     value. Otherwise, 'm' must be a vector of length equal to the
     number of points in 'X', and the point 'X[i]' will receive the
     mark 'm[i]'.

     Use 'unmark' to remove marks. Use 'ppp' to create point patterns
     in more general situations.

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

     Marked point pattern (object of class '"ppp"') identical to 'X'
     except that it has marks equal to 'm'.

_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:

     'unmark', 'ppp.object', 'is.marked', 'is.marked.ppp'

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

        data(cells)

        m <- runif(cells$n)

        Y <- setmarks(cells, m)
        Y <- cells %mark% m
        # equivalent

        ## Not run: plot(Y)
        is.marked(Y)  #TRUE

