Description Usage Arguments Value Author(s) Examples
Generates the coordinates of randomly selected points in good habitat. This can be used to generate starting values for JAGS analysis.
1 | randomPoints(n, JAGSmask, fixed)
|
n |
The number of random points required. |
JAGSmask |
An object of class |
fixed |
A 2-column matrix or data frame with fixed locations, which will be included unchanged at the top of the output matrix (if |
An n x 2 matrix with the coordinates of points in suitable habitat on the scale of habMat
.
Mike Meredith
1 2 3 4 5 6 7 8 9 10 11 12 13 | data(simSCR)
plot(simSCR$JAGSmask)
# Create a few locations in good habitat:
( locs <- randomPoints(3, simSCR$JAGSmask) )
points(locs, pch=16)
# Treat these as fixed locations in a set of 10:
( rand <- randomPoints(10, simSCR$JAGSmask, fixed=locs) )
points(rand, pch=16, col='blue')
# Change one of the 'locs' to bad habitat
locs[2, ] <- c(2, 24)
randomPoints(10, simSCR$JAGSmask, fixed=locs) # Gives a warning.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.