#### Instructions for Creating and Using Detection Histories

1. Basic Settings
   - Species Selection:
     - Choose target species from dropdown menu
     - Only species present in record table are shown
   - Occasion Length:
     - Define the length of sampling occasions in days
     - Maximum length depends on total survey duration
     - Consider species behavior and survey design when choosing length
   - Output Type:
     - Binary (0/1): Records detection/non-detection in each occasion
     - Count: Records number of detections in each occasion
     - Binary typically used for occupancy models
   - Day 1 Definition:
     - Survey: Start all stations from first day of overall survey
     - Station: Start each station from its own setup date
     - Affects how occasions are aligned across stations
2. Output Components
   - Summary Statistics:
     - Total number of records for selected species
     - Number of detections in detection history
     - Number of stations with detections
     - Percentage of occasions with detections
   - Detection History Plot:
     - Left panel: Detection matrix (0/1 or counts)
     - Right panel: Camera operation/effort matrix
     - Rows represent stations
     - Columns represent sampling occasions
     - Color intensity indicates detection/effort values
   - unmarkedFrame Summary:
     - Shows structure of data formatted for unmarked package
     - Includes number of sites and occasions
     - Lists available covariates
     - Displays observation model type
3. Export Options
   - Detection History:
     - Export raw detection history matrix
     - Includes both detection and effort matrices
     - Useful for custom analyses or verification
   - unmarkedFrame:
     - Export formatted data ready for occupancy modeling
     - Includes all necessary components for analysis: detection history, site covariates, observation covariate 'effort'
     - Can be used directly with unmarked or ubms package functions

#### Notes:

- Detection histories form the basis for occupancy modeling
- Missing values (NA) occur when cameras were not operational
- Data sets should have >20 stations for accurate estimates, especially for rare species and when covariate effects are of interest
- Ensure sufficient detections for reliable model estimation
- Check camera operation matrix for adequate survey effort
- Binary format appropriate for most single-season occupancy models

#### Relevant functions

- `detectionHistory`