Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rstrat

Simulate Stratified Random Point Pattern


Description

Generates a “stratified random” pattern of points in a window, by dividing the window into rectangular tiles and placing k random points independently in each tile.

Usage

rstrat(win=square(1), nx, ny=nx, k = 1, nsim=1, drop=TRUE)

Arguments

win

A window. An object of class owin, or data in any format acceptable to as.owin().

nx

Number of tiles in each column.

ny

Number of tiles in each row.

k

Number of random points to generate in each tile.

nsim

Number of simulated realisations to be generated.

drop

Logical. If nsim=1 and drop=TRUE (the default), the result will be a point pattern, rather than a list containing a point pattern.

Details

This function generates a random pattern of points in a “stratified random” sampling design. It can be useful for generating random spatial sampling points.

The bounding rectangle of win is divided into a regular nx * ny grid of rectangular tiles. In each tile, k random points are generated independently with a uniform distribution in that tile.

Some of these grid points may lie outside the window win: if they do, they are deleted.

The result is a point pattern inside the window win.

This function is useful in creating dummy points for quadrature schemes (see quadscheme) as well as in simulating random point patterns.

Value

A point pattern (an object of class "ppp") if nsim=1, or a list of point patterns if nsim > 1.

Author(s)

and Rolf Turner r.turner@auckland.ac.nz

See Also

Examples

X <- rstrat(nx=10)
  plot(X)

  # polygonal boundary
  X <- rstrat(letterR, 5, 10, k=3)
  plot(X)

spatstat.core

Core Functionality of the 'spatstat' Family

v2.1-2
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Kasper Klitgaard Berthelsen [ctb], Achmad Choiruddin [ctb], Jean-Francois Coeurjolly [ctb], Ottmar Cronie [ctb], Tilman Davies [ctb], Julian Gilbey [ctb], Yongtao Guan [ctb], Ute Hahn [ctb], Kassel Hingee [ctb], Abdollah Jalilian [ctb], Marie-Colette van Lieshout [ctb], Greg McSwiggan [ctb], Tuomas Rajala [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Plenge Waagepetersen [ctb], Hangsheng Wang [ctb]
Initial release
2021-04-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.