| verify | R Documentation |
Check that the data and attributes of an object are internally consistent to avoid crashing functions such as secr.fit
## 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, ...)
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) |
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 (not required for unmarked data, or for telemetry type ‘marking’ with sightings and no animals)
Missing values not allowed in capthist
Signal detector signal(s) less than threshold or invalid threshold; ‘signal’ attribute does not match detections
Live detection(s) after reported dead
Empty detection histories (except concurrent or marking telemetry and all-sighting data)
More than one detection per detector per occasion at binary detector(s) (‘single’, ‘multi’, ‘proximity’, ‘polygonX’, ‘transectX’, ‘signal’ or ‘signalnoise’)
More than one capture in single-catch trap(s)
Animal detected at more than one detector on an occasion (‘multi’, ‘polygonX’ or ‘transectX’ detectors)
Counts less than zero (‘count’, ‘polygon’ or ‘transect’ detectors)
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, or missing
Inconsistencies in resighting data: dimensions of ‘markocc’, ‘Tu’ or ‘Tm’ incompatible with the capthist, or counts negative or not whole numbers; sightings at unused detectors; new animals on a sighting-only occasion; sightings on a marking-only occasion
Inconsistencies in telemetry data: occasions with no detections; number or names of telemetered animals, or number of locations, not matching the detections; for ‘dependent’ telemetry, animals with an all-zero detection history; for ‘marking’ telemetry, a detection history without telemetry locations or a telemetered animal without a detection history; for ‘independent’ telemetry, non-zero detection histories
Invalid non-target data
For multi-session data each session is checked separately, and the following checks are also
made across sessions: levels of factor covariate(s) differ between sessions (a warning, not an
error; see shareFactorLevels); individual covariates present in some sessions and
NULL in others (stops with an error).
verify.traps
Missing detector coordinates not allowed
Number of rows in dataframe of detector covariates differs from expected
Invalid combination of detector types (a mixture of types is allowed only for point detectors – ‘single’, ‘multi’, ‘proximity’, ‘count’, ‘signal’, ‘signalnoise’, ‘unmarked’ or ‘presence’ – with or without ‘telemetry’)
Number of detectors in usage matrix differs from expected
Number of occasions in usage matrix differs from the length of the detector attribute
Occasions with no used detectors
Number of occasions in markocc differs from usage matrix (resighting data)
Values in markocc other than -2, -1, 0 or 1 (resighting data)
Polygons overlap, or no search area specified (‘polygon’ or ‘polygonX’ detectors)
PolyID missing or not factor (‘polygon’ or ‘polygonX’ detectors)
Polygon concave in east-west direction (‘polygon’ or ‘polygonX’ detectors)
More than one row in the notional traps object for telemetry (telemetry-only data)
For multi-session data each session is checked separately, and the following checks are also made across sessions: levels of factor trap covariate(s) differ between sessions (a warning); trap covariates present in some sessions and NULL in others (stops with an error).
verify.mask
Valid x and y coordinates
Number of rows in covariates dataframe differs from expected
For multi-session data each session is checked separately, and levels of factor mask covariate(s) are also compared between sessions (a warning).
Earlier errors may mask later errors: fix & re-run.
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. For a single-session capthist the list also has components
trapcheck (the result of verify.traps) and captcheck (a list of logical
values, one for each group of checks on the detections), and, if there are detections at unused
detectors, detections.at.unused.detectors. For a traps object the components include the
logical result of each check. The value is returned invisibly.
Full reporting is the same as ‘errors only’ except that a message is posted when no errors are found.
capthist, make.marking, 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.