Check that the data and attributes of an object are internally consistent to avoid crashing functions such as secr.fit
# S3 method for default
verify(object, report, ...)
# S3 method for traps
verify(object, report = 2, ...)
# S3 method for capthist
verify(object, report = 2, tol = 0.01, ...)
# S3 method for mask
verify(object, report = 2, ...)
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.
an object of class `traps', `capthist' or `mask'
integer code for level of reporting to the console. 0 = no report, 1 = errors only, 2 = full.
numeric tolerance for deviations from transect line (m)
other arguments (not used)
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
No `traps' component
Invalid `traps' component reported by verify.traps
No live detections
Missing values not allowed in capthist
Live detection(s) after reported dead
Empty detection histories (except concurrent telemetry and all-sighting data)
More than one capture in single-catch trap(s)
More than one detection per detector per occasion at proximity detector(s)
Signal detector signal(s) less than threshold or invalid threshold
Number of rows in `traps' object not compatible with reported detections
Number of rows in dataframe of individual covariates differs from capthist
Number of occasions in usage matrix differs from capthist
Detections at unused detectors
Number of coordinates does not match number of detections (`polygon', `polygonX', `transect' or `transectX' detectors)
Coordinates of detection(s) outside polygons (`polygon' or `polygonX' detectors)
Coordinates of detection(s) do not lie on any transect (`transect' or `transectX' detectors)
Row names (animal identifiers) not unique
Levels of factor covariate(s) differ between sessions
verify.traps
Missing detector coordinates not allowed
Number of rows in dataframe of detector covariates differs from expected
Number of detectors in usage matrix differs from expected
Occasions with no used detectors
Polygons overlap
Polygons concave east-west (`polygon' detectors)
PolyID missing or not factor
Polygon detector is concave in east-west direction
Levels of factor trap covariate(s) differ between sessions
verify.mask
Valid x and y coordinates
Number of rows in covariates dataframe differs from expected
Levels of factor mask covariate(s) differ between sessions
Earlier errors may mask later errors: fix & re-run.
capthist
, secr.fit
, shareFactorLevels
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