snip: Slice Transect Into Shorter Sections

Description Usage Arguments Details Value See Also Examples

Description

This function splits the transects in a ‘transect’ or ‘transectX’ traps object into multiple shorter sections. The function may also be applied directly to a capthist object based on transect data. This makes it easy to convert detection data collected along linear transects to point detection data (see Example).

Usage

1
snip(object, from = 0, by = 1000, length.out = NULL, keep.incomplete = TRUE)

Arguments

object

secr ‘traps’ or ‘capthist’ object based on transects

from

numeric starting posiiton (m)

by

numeric length of new transects (m)

length.out

numeric number of new transects, as alternative to ‘by’

keep.incomplete

logical; if TRUE then initial or terminal sections of each original transect that are less than ‘by’ will be retained in the output

Details

If a positive length.out is specified, by will be computed as (transectlength(object) - from) / length.out.

Value

A ‘traps’ or ‘capthist’ object, according to the input. If keep.incomplete == FALSE animals and detections from the

See Also

transectlength, discretize

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
x <- seq(0, 4*pi, length = 41)
temptrans <- make.transect(x = x*100, y = sin(x)*300)
plot (snip(temptrans, by = 200), markvertices = 1)

## Not run: 

## simulate some captures
tempcapt <- sim.capthist(temptrans, popn = list(D = 2,
   buffer = 300), detectfn = 'HHN', binomN = 0,
   detectpar = list(lambda0 = 0.5, sigma = 50))

## snip capture histories
tempCH <- snip(tempcapt, by = 20)

## collapse from 'transect' to 'count', discarding location within transects
tempCH <- reduce(tempCH, outputdetector = "count")

## fit secr model and examine H-T estimates of density
## fails with detectfn = 'HN'
fit <- secr.fit(tempCH, buffer = 300, CL = TRUE, detectfn = 'HHN', trace = FALSE)
derived(fit)

## also, may split an existing transect into equal lengths
## same result:
plot(snip(temptrans, by = transectlength(temptrans)/10),
    markvertices = 1)
plot(snip(temptrans, length.out = 10), markvertices = 1)


## End(Not run)

secr documentation built on Oct. 18, 2021, 9:06 a.m.