
Last chance! 50% off unlimited learning
Sale ends in
Functions that are called internally by secrdesign. These are exported and may be called separately for testing etc.
compactSample (traps, n)GApenfn(traps, sigma)
'outputtype<-'(object, value)
GApenfn -- a numeric vector with the number of trap pairs separated by 2.5-3.5 sigma and 3.5-4.5 sigma.
compactSample -- an object like traps, but with only n rows.
secr trapsobject
integer number in sample (
numeric sparial scale parameter
object output from run.scenarios
replacement value for outputtype of object
compactSample
selects a detector at random and returns the a compact subset of surrounding detectors.
GApenfn
is the default pen_fn used by GAoptim
When called with a non-null penalty argument.
Values of outputtype map to class of the run.scenarios output as follows
Output type | Class | secrfit |
c("fittedmodels", "secrdesign", "list") | ipsecrfit | c("fittedmodels", "secrdesign", "list") |
predicted | c("estimatetables", "secrdesign", "list") | derived |
c("estimatetables", "secrdesign", "list") | regionN | c("estimatetables", "secrdesign", "list") |
coef | c("estimatetables", "secrdesign", "list") | user |
c("estimatetables", "secrdesign", "list") | secrsummary | c("summary", "secrdesign", "list") |
capthist | c("rawdata", "secrdesign", "list") | selectedstatistics |
Calling the replacement function automatically changes the class of the output object as appropriate. This determines how the output is handled by downstream functions such as summary
. Using a custom extractfn or post-processing the output sometimes requires the outputtype to be set manually (see example in the Multi-model section of secrdesign-vignette.pdf).
Durbach, I., Borchers, D., Sutherland, C. and Sharma, K. (2021) Fast, flexible alternatives to regular grid designs for spatial capture--recapture. Methods in Ecology and Evolution 12, 298--310. tools:::Rd_expr_doi("10.1111/2041-210X.13517")
GAoptim
,
CStraps <- compactSample(traps(captdata), n = 20)
plot(traps(captdata))
plot(CStraps, add = TRUE, detpar = list(fg = 'blue',pch = 16))
GApenfn(CStraps, sigma = 25)
Run the code above in your browser using DataLab