Internal {secrdesign}R Documentation

Internal Functions

Description

Functions that are called internally by secrdesign. These are exported and may be called separately for testing etc.

Usage


compactSample (traps, n)

GApenfn(traps, sigma)

'outputtype<-'(object, value)

Arguments

traps

secr trapsobject

n

integer number in sample (0 < n \le ntraps)

sigma

numeric sparial scale parameter

object

object output from run.scenarios

value

replacement value for outputtype of object

Details

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 c("selectedstatistics", "secrdesign", "list")

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).

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.

References

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. DOI 10.1111/2041-210X.13517

See Also

GAoptim,

Examples


CStraps <- compactSample(traps(captdata), n = 20)

plot(traps(captdata))
plot(CStraps, add = TRUE, detpar = list(fg = 'blue',pch = 16))

GApenfn(CStraps, sigma = 25)


[Package secrdesign version 2.9.1 Index]