Check SECR Data

Share:

Description

Check that the data and attributes of an object are internally consistent to avoid crashing functions such as secr.fit

Usage

1
2
3
4
5
6
7
8
## Default S3 method:
verify(object, report, ...)
## S3 method for class 'traps'
verify(object, report = 2, ...)
## S3 method for class 'capthist'
verify(object, report = 2, tol = 0.01, ...)
## S3 method for class 'mask'
verify(object, report = 2, ...)

Arguments

object

an object of class ‘traps’, ‘capthist’ or ‘mask’

report

integer code for level of reporting to the console. 0 = no report, 1 = errors only, 2 = full.

tol

numeric tolerance for deviations from transect line (m)

...

other arguments (not used)

Details

Checks are performed specific to the class of ‘object’. The default method is called when no specific method is available (i.e. class not ‘traps’, ‘capthist’ or ‘mask’), and does not perform any checks.

verify.capthist

  1. No ‘traps’ component

  2. Invalid ‘traps’ component reported by verify.traps

  3. No live detections

  4. Missing values not allowed in capthist

  5. Live detection(s) after reported dead

  6. More than one capture in single-catch trap(s)

  7. More than one detection per detector per occasion at proximity detector(s)

  8. Signal detector signal(s) less than threshold or invalid threshold

  9. Number of rows in ‘traps’ object not compatible with reported detections

  10. Number of rows in dataframe of individual covariates differs from capthist

  11. Number of occasions in usage matrix differs from capthist

  12. Detections at unused detectors

  13. Number of coordinates does not match number of detections (‘polygon’, ‘polygonX’, ‘transect’ or ‘transectX’ detectors)

  14. Coordinates of detection(s) outside polygons (‘polygon’ or ‘polygonX’ detectors)

  15. Coordinates of detection(s) do not lie on any transect (‘transect’ or ‘transectX’ detectors)

  16. Row names (animal identifiers) not unique

  17. Levels of factor covariate(s) differ between sessions

verify.traps

  1. Missing detector coordinates not allowed

  2. Number of rows in dataframe of detector covariates differs from expected

  3. Number of detectors in usage matrix differs from expected

  4. Occasions with no used detectors

  5. Polygons overlap

  6. Polygons concave east-west (‘polygon’ detectors)

  7. PolyID missing or not factor

  8. Polygon detector is concave in east-west direction

  9. Levels of factor trap covariate(s) differ between sessions

verify.mask

  1. Valid x and y coordinates

  2. Number of rows in covariates dataframe differs from expected

  3. Levels of factor mask covariate(s) differ between sessions

Earlier errors may mask later errors: fix & re-run.

Value

A list with the component errors, a logical value indicating whether any errors were found. If object contains multi-session data then session-specific results are contained in a further list component bysession.

Full reporting is the same as ‘errors only’ except that a message is posted when no errors are found.

See Also

capthist, secr.fit

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
verify(captdata)

## create null (complete) usage matrix, and mess it up
temptraps <- make.grid()
usage(temptraps) <- matrix(1, nr = nrow(temptraps), nc = 5)
usage(temptraps)[,5] <- 0
verify (temptraps)

## create mask, and mess it up
tempmask <- make.mask(temptraps)
verify(tempmask)
tempmask[1,1] <- NA
verify(tempmask)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.