verify                 package:secr                 R Documentation

_C_h_e_c_k _S_E_C_R _D_a_t_a

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     ## Default S3 method:
     verify(object, report, ...)
     ## S3 method for class 'traps':
     verify(object, report = 2, ...)
     ## S3 method for class 'capthist':
     verify(object, report = 2, ...)
     ## S3 method for class 'mask':
     verify(object, report = 2, ...)

_A_r_g_u_m_e_n_t_s:

  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. 

     ...: other arguments (not used)  

_D_e_t_a_i_l_s:

     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.  Number of rows in 'traps' object not compatible with
           reported detections

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

        10.  Number of occasions in usage matrix differs from capthist

        11.  Detections at unused 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

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

_V_a_l_u_e:

     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.

_A_u_t_h_o_r(_s):

     Murray Efford murray.efford@otago.ac.nz

_S_e_e _A_l_s_o:

     'capthist', 'secr.fit'

_E_x_a_m_p_l_e_s:

     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)

