ppp                 package:spatstat                 R Documentation

_C_r_e_a_t_e _a _P_o_i_n_t _P_a_t_t_e_r_n

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

     Creates an object of class `"ppp"' representing  a point pattern
     dataset in the two-dimensional plane.

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

       ppp(x,y, xrange, yrange, marks)
       ppp(x,y, window, marks)
       ppp(x,y, poly, marks)
       ppp(x,y, mask, marks)
       ppp(x,y, ..., marks)

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

       x: Vector of x coordinates of data points

       y: Vector of y coordinates of data points

  xrange: x coordinate limits of enclosing box

  yrange: y coordinate limits of enclosing box

   marks: (optional) vector of mark values

    poly: vertices of polygonal boundary of window

    mask: logical matrix giving binary image of window

  window: window of observation, an object of class `"owin"'

     ...: arguments passed to `owin' to create the window

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

     In the `spatstat' library, a point pattern dataset is described by
     an object of class `"ppp"'. This function creates such objects.

     The vectors `x' and `y' must be numeric vectors of equal length.
     They are interpreted as the cartesian coordinates of the points in
     the pattern.

     A point pattern dataset is assumed to have been observed within a
     specific region of the plane called the observation window. An
     object of class `"ppp"' representing a point pattern contains
     information specifying the observation window. This window must
     always be specified when creating a point pattern dataset; there
     is intentionally no default action of ``guessing'' the window
     dimensions from the data points alone. 

     You can specify the observation window in several (mutually
     exclusive) ways:

        *  `xrange, yrange' specify a rectangle with these dimensions;

        *  `poly' specifies a polygonal boundary. If the boundary is a
           single polygon then `poly' must be a list with components
           `x,y' giving the coordinates of the vertices. If the
           boundary consists of several disjoint polygons then `poly'
           must be a list of such lists so that `poly[[i]]$x' gives the
           x coordinates of the vertices of the ith boundary polygon.

        *  `mask' specifies a binary pixel image with entries that are
           `TRUE' if the corresponding pixel is inside the window.

        *  `window' is an object of class `"owin"' (see `owin.object')
           specifying the window.

     The arguments `xrange, yrange' or `poly' or `mask' are passed to
     the window creator function `owin' for interpretation. See `owin'
     for further details.

     The argument `window', if given, must be an object of class
     `"owin"'. It is a full description of the window geometry, and
     could have been obtained from `owin' or `as.owin', or by just
     extracting the observation window of another point pattern, or by
     manipulating such windows. See `owin' or the Examples below.

     The optional argument `marks' is given if the point pattern is
     marked, i.e. if each data point carries additional information.
     For example, points which are classified into two or more
     different types, or colours, may be regarded as having a mark
     which identifies which colour they are. Data recording the
     locations and heights of trees in a forest can be regarded as a
     marked point pattern where the mark is the tree height.

     In the current implementation, `marks' must be a vector, of the
     same length as `x' and `y', which is interpreted so that
     `marks[i]' is the mark attached to the point `(x[i],y[i])'. If the
     mark is a real number then `marks' should be a numeric vector,
     while if the mark takes only a finite number of possible values
     (e.g. colours or types) then `marks' should be a `factor'.

     See `ppp.object' for a description of the class `"ppp"'.

     Users would normally invoke `ppp' to create a point pattern, but
     the functions `as.ppp' and  `scanpp' may sometimes be convenient.

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

     An object of class `"ppp"'  describing a point pattern in the
     two-dimensional plane (see `ppp.object').

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

     `ppp.object', `as.ppp', `owin.object', `owin', `as.owin'

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

       library(spatstat)

       # some arbitrary coordinates in [0,1]
       x <- runif(20)
       y <- runif(20)

       # the following are equivalent
       X <- ppp(x, y, c(0,1), c(0,1))
       X <- ppp(x, y)
       X <- ppp(x, y, window=owin(c(0,1),c(0,1)))

       plot(X)

       # marks
       m <- sample(1:2, 20, replace=TRUE)
       m <- factor(m, levels=1:2)
       X <- ppp(x, y, c(0,1), c(0,1), marks=m)
       plot(X)

       # polygonal window
       X <- ppp(x, y, poly=list(x=c(0,10,0), y=c(0,0,10)))
       plot(X)

       # copy the window from another pattern
       data(cells)
       X <- ppp(x, y, window=cells$window)

