This function is a simple substitute for the secr function
`sim.popn()`

for the case of a linear habitat.

1 | ```
sim.linearpopn(mask, D, N, Ndist = c('poisson', 'fixed'), ...)
``` |

`mask` |
linearmask object |

`D` |
numeric density animals / km |

`N` |
number of individuals |

`Ndist` |
character string for distribution of total number of individuals |

`...` |
other arguments passed to |

The linearmask input represents a discretized line - essentially a chain
of line segments. By default, each segment is populated with a Poisson number of
individuals. The user may specify `D`

or `N`

.

`D`

may be a vector with one density per mask pixel, or a single
number that will be applied across all pixels.

If `Ndist = 'fixed'`

then a constant number of individuals N are
simulated in each trial; otherwise N has a Poisson distribution across
trials. N = sum(`D`

) x mask length if `D`

is
specified.

This is a simplified wrapper for `sim.popn`

called
with `model2D = "linear"`

.

Object of class c(‘linearpopn’, ‘popn’, ‘data.frame’).

The population output from `sim.linearpopn`

may be used unchanged
with secr functions such as
`sim.capthist`

. However, to be faithful to the
linear network you should set the ‘userdist’ argument of
`sim.capthist`

to `networkdistance`

.

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
x <- seq(0, 4*pi, length = 200)
xy <- data.frame(x = x*100, y = sin(x)*300)
mask <- read.linearmask(data = xy, spacing = 10)
trps <- make.line(mask, n = 15, startbuffer = 1000, by = 30)
newmask <- clipmask(mask, trps, buffer = 200)
linpop <- sim.linearpopn(newmask, 200)
CH <- sim.capthist(trps, linpop, userdist = networkdistance)
plot(newmask)
plot(CH, add = TRUE)
secr.fit(CH, mask = mask, details = list(userdist = networkdistance))
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.