Description Usage Arguments Details Functions Arguments details
Draw rectangular quadrats in a plot at random. Returns a dataframe of coordinates defining the corners of all the quadrats.
1 2 3 4 5 6 7 | selectrandomquad(size, shape, rep, plotdim = c(1000, 500),
graphit = FALSE)
selectrandomquad2(size, rep, plotdim = c(1000, 500), graphit = FALSE)
selectrandomquad3(size, shape, rep, plotdim = c(1000, 500),
graphit = FALSE)
|
size |
A vector of quadrat sizes, referring to the x-dimension of a rectangular quadrat. |
shape |
The ratio of y to x dimensions of the rectangles; |
rep |
The number of replicated random quadrats (per dimension submitted) to create. |
plotdim |
The x and y dimensions of the plot. |
graphit |
Logical; if |
Quadrats are chosen simply: a point is chosen by randomly drawing one x and
one y coordinates to serve as the lower-left corner. The x
is chosen from a
uniform distribution between 0 and plotdim[1]-size
; y
is chosen
similarly.
All 3 algorithms (selectrandomquad()
, selectrandomquad2()
and
selectrandomquad3()
) under sample the plot corners. That bias,
selectrandomquad2()
and selectrandomquad3()
intended to overcome; but
neither does.
selectrandomquad2
: Its algorithm aims at capturing corners. The
result, however, is not to capture corners any better than
selectrandomquad()
does.
Imagine a line running vertically at x = 0
from y = 0
to
y = plotdim[2] - size
, then continues at x = 1
from 0 to
plotdim[2] - size
, etc. It's wrapping analogous to the way quadrat indices
wrap (see ?gxgy.to.index
). This line has length
(plotdim[1] - size) * (plotdim[2] - size)
. Draw a random number on that
line, and place the lower left corner of random square at that point. A
position x
on the line is converted to plot coordinates gx
, gy
using
function index.to.gxgy()
with grid = 1
.
selectrandomquad3
: The lower left x, y coordinates are drawn at
random from a range extending outside the plot dimensions, then quadrats
are used only if all 4 corners fall inside the plot.
graphit
Whether to graph the locations of the chosen quadrats on a
plot map.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.