verify {secr} | R Documentation

## 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

    ## 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. Count detector counts less than zero
9. Signal detector signal(s) less than threshold or invalid threshold
10. Number of rows in 'traps' object not compatible with reported detections
11. Number of rows in dataframe of individual covariates differs from capthist
12. Number of occasions in usage matrix differs from capthist
13. Detections at unused detectors
14. Coordinates of detection(s) outside polygons ('polygon' detectors)
15. Coordinates of detection(s) do not lie on any transect ('transect' detectors)

`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. Area detectors, but quadrats overlap or no area specified

`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.

### 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.

### Author(s)

Murray Efford murray.efford@otago.ac.nz

### See Also

`capthist`, `secr.fit`

### Examples

    data(captdata)
    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)

[Package secr version 1.3.0 Index]