sample.sad | R Documentation |
Samples a desired number of individuals from an sad
object.
sample.sad(x, size, replace = FALSE, prob = NULL)
x |
an object of class |
size |
the number of individuals to sample from the SAD |
replace |
logical, should sampling be done with replacement or without |
prob |
an optional numeric specifying probability of inclusion in a sample, either a
single scalar value or vector of length equal to length of |
If a single scalar values is supplied for prob
, size will be
calculated as size = prob*sum(x)
; if a vector of length equal to length of x
is giving this will
not change the value of size
but rather indicate the relative probabilities of each species
appearing in the sample (e.g. for simulating species-specific detection bias)
A numeric vector of variable length depending on how many species have sampled abundance > 0
Andy Rominger <ajrominger@gmail.com>
sample
x <- rtpois(1000, 2) sad1 <- fitSAD(x, models='tpois') sample(sad1[[1]], 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.