Chapter 5 Summarize survey

Here we will summarize the 2017 & 2020 survey data we prepared on the previous page.

load('whiceas_cruz_1720.RData')

Summarize effort

The summarize_effort() functions builds tables with total kilometers and days surveyed.

effort <- summarize_effort(cruz_1720,
                           cohort=1)

This function summarizes effort in several default tables:

effort %>%  names()
[1] "total"            "total_by_cruise"  "total_by_year"    "total_by_effort" 
[5] "total_by_stratum"

Total surveyed

The slot $total provides the grand total distance and unique dates surveyed:

library(DT)

effort$total %>% 
  DT::datatable(options=list(initComplete = htmlwidgets::JS(
          "function(settings, json) {$(this.api().table().container()).css({'font-size': '9pt'});}")
       )) 

The column days shows the total unique dates of the year on which effort occurred, and the column cruise_days accounts for the possibility that multiple cruises were at sea simultaneously.

Total surveyed by effort

The slot $total_by_effort provides the total distance and days surveyed, grouped by segments that will be included in the analysis and those that won’t:

Total surveyed by stratum

The slot $total_by_stratum provides the total distance and days surveyed within each stratum, again grouped by segments that will be included in the analysis and those that won’t:

Summarize by Beaufort

bft <- summarize_bft(cruz_1720, cohort=1)

This function summarizes effort by Beaufort in four default tables:

bft %>%  names()
[1] "overall"    "by_year"    "by_stratum" "details"   

Simple overall breakdown

The slot $overall provides the total effort – and proportion of effort – occurring in each Beaufort state:

Breakdown by year

The slot $by_year provides the above for each year separately:

Breakdown by stratum

The slot $by_stratum provides the above for each geostratum separately:

Detailed breakdown

The slot $details provides the above for each cruise-year-study area-geostratum combination within the data:

Default filtering

By default, this function only summarizes effort that can be used for detection function model fitting, (i.e., where the column use is TRUE). To turn off this filter, you can change the input use_only to FALSE:

summarize_bft(cruz_1720, use_only = FALSE)$overall
# A tibble: 6 × 3
    Bft    km   prop
  <dbl> <dbl>  <dbl>
1     1  217. 0.0184
2     2  851. 0.0723
3     3 1360. 0.116 
4     4 3601. 0.306 
5     5 3843. 0.327 
6     6 1894. 0.161 

Summarize sightings

The summarize_sightings() function builds tables summarizing the sightings within each cohort-analysis. (Eventually, we may want to include an option to merge all sightings from all cohort-analyses into a single table.)

sightings <- summarize_sightings(cruz_1720,
                                 cohort=1)

This function summarizes sightings in four default tables:

sightings %>%  names()
[1] "simple_totals"           "analysis_totals"        
[3] "stratum_simple_totals"   "stratum_analysis_totals"

Simple species totals

The slot $simple_totals includes all sightings, even if they will not be included in analysis (i.e., even if the include column is FALSE):

Analysis totals

The slot $analysis_totals only includes sightings that meet all inclusion criteria for the analysis:

Simple totals for each stratum

The slot $stratum_simple_totals splits the first table (simple species totals) so that sightings are tallied for each geo-stratum separately:

Analysis totals for each stratum

The slot $stratum_analysis_totals splits the second table (analysis totals for each species) so that sightings are tallied for each geo-stratum separately:

Summarize certain species

To deep-dive into details for a ceratin species (or group of species), use the function summarize_species().

species <- summarize_species(spp='046', cruz_1720)

This functions a list with a variety of summaries:

species %>% names
 [1] "species"             "n_total"             "n_analysis"         
 [4] "school_size"         "yearly_total"        "yearly_analysis"    
 [7] "regional_total"      "regional_analysis"   "detection_distances"
[10] "sightings"          

The slots $n_total and $n_analysis provide the total number of sightings and the number eligible for inclusion in the analysis:

species$n_total
[1] 14
species$n_analysis
[1] 14

School size details

This table only includes the sightings eligible for analysis:

Annual summaries (all sightings)

Annual summaries (analysis only)

Regional summaries (all sightings)

Regional summaries (analysis only)

Detection distances

This table can be used to determine the best truncation distance to use, based on the percent truncation you wish and the number of sightings available at each option.

All sightings data

Finally, this last slot holds a dataframe of all sightings data for the specified species:

cruz_explorer()

Note that all of these summary tables can be viewed interactively using the function cruz_explorer(), which allows you to efficiently subset the data according to various filters.

cruz_explorer(cruz_1720)