Learn R Programming

secr (version 4.4.5)

extractMoves: Simulated Movements

Description

Extract movements from a previously simulated multi-session population.

Usage

extractMoves(pop, plotn = NULL, add = FALSE, collapse = TRUE, maxradius = Inf, ...)

Arguments

pop

popn object from sim.popn

plotn

integer maximum number of instances to plot at each session

add

logical for whether to add to existing plot

collapse

logical; if TRUE plots for sessions 2, 3,... are added to the first

maxradius

numeric radius for selecting subset of initial locations

arguments passed to arrows (length = 0 to suppress arrows)

Value

List of data frames, one for each session but the last (columns 'x1','y1','x2','y2','d').

Details

This function is mostly used to check the movement simulations.

Moves are constrained by the edge (argument `edgemethod' of sim.popn). `maxradius' may be set to restrict the extraction to the subset of animals initially near the centroid of the arena in each session.

See Also

turnover, sim.popn

Examples

Run this code
# NOT RUN {
set.seed(12345)
pop3 <- sim.popn(D = 2, core = make.grid(), buffer = 200, nsessions = 3, 
    details = list(lambda = 1.0, movemodel = 'BVE', move.a = 50, 
    edgemethod = 'stop'))
m <- extractMoves(pop3, plotn = 10, length = 0.1) # shorten arrow heads
mean(unlist(sapply(m, '[', 'd')))                 # less than nominal
# }

Run the code above in your browser using DataLab