Learn R Programming

secr (version 2.4.0)

verify: Check SECR Data

Description

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

Usage

## S3 method for class 'default':
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)

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.

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
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
verify.mask
  1. Valid x and y coordinates
  2. Number of rows in covariates dataframe differs from expected
Earlier errors may mask later errors: fix & re-run.

See Also

capthist, secr.fit

Examples

Run this code
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)

Run the code above in your browser using DataLab