knitr::opts_chunk$set(echo = FALSE, collapse = TRUE, comment = "#>", warning = FALSE, message = FALSE)
options(rmarkdown.html_vignette.check_title = FALSE)
library(fontawesome)
library(htmltools)
# select the CSS file
css_file = system.file("resources/KuskoHarv-vignette-styles.css", package = "KuskoHarvUtils")

# combine with style tags
css = c("<style>", readLines(css_file), "</style>") |> 
  paste(collapse = "\n")

r css

This vignette gives an overview of the various data sets found in 'KuskoHarvData'. Each of these data sets (for example, the opener metadata) can be loaded by running:

data(openers_all, package = "KuskoHarvData")

Then this data set can be used by simply referring to the object called openers_all.

Several of the data sets included have a spatial component (geographic strata A, B, C, and D1) -- these are shown on the map below.

Map of Study Area

knitr::include_graphics(system.file("resources/map.png", package = "KuskoHarvUtils"))

vars_table = function(m, footnote_args = NULL) {

  # make variable names italic
  m[,1] = kableExtra::cell_spec(m[,1], monospace = TRUE)

  # build the kable
  out = kableExtra::kbl(m, row.names = FALSE, col.names = c("Variable", "Description"), escape = FALSE) |> 
    kableExtra::kable_styling(full_width = TRUE, bootstrap_options = c("condensed"), font_size = 12)

  if (!is.null(footnote_args)) {
    out = do.call(kableExtra::footnote, append(list(kable_input = out), footnote_args))
  }

  return(out)
}

data_table = function(x, FUN, n = 10) {
  FUN(x, n = n) |> 
    kableExtra::kbl(row.names = TRUE) |> 
    kableExtra::kable_styling(full_width = TRUE, bootstrap_options = c("condensed"), font_size = 12) |> 
    kableExtra::column_spec(1, monospace = TRUE, color = "grey")
}

r fa("table") Opener Metadata

::::::{.indent}

data(openers_all, package = "KuskoHarvData")

:::{.describe} Each row represents one drift gillnet opener. :::

Variable Descriptions

matrix(c(
  # VARIABLE                              # DESCRIPTION
  "start; end",        "Start and end dates/times of the opener",
  "flights_planned",   "Number of aerial surveys planned for the day",
  "flights_flown",     "Number of aerial surveys completed for the day",
  "announcement",      "Identifier of the official agency announcement authorizing the opener (not always available)"
), ncol = 2, byrow = TRUE) |> 
vars_table()

r hr()

View First 10 Rows

data_table(openers_all, head)

r hr()

View Last 10 Rows

data_table(openers_all, tail)

r hr()

Variable Summary

summary(openers_all)

::::::

r fa("table") Compiled Harvest Estimates

::::::{.indent}

data(harv_est_all, package = "KuskoHarvData")

:::{.describe} Each row represents one summary statistic (mean, standard deviation, lower/upper 95% confidence limits) of harvest for one species, in one geographic stratum, in one day. :::

Variable Descriptions

matrix(c(
  # VARIABLE                              # DESCRIPTION
  "date",        "The date to which the estimate applies",
  "species",     "The species to which the estimate applies",
  "stratum",     "The geographic stratum to which the estimate applies",
  "quantity",    "The summary statistic of bootstrapped harvest estimates: point estimate (`mean`), standard deviation (`sd`), and 95% confidence limits (`lwr95` and `upr95`)",
  "estimate",    "The estimated value of the harvest summary statistic"
), ncol = 2, byrow = TRUE) |> 
vars_table()

r hr()

View First 10 Rows

data_table(harv_est_all, head)

r hr()

View Last 10 Rows

data_table(harv_est_all, tail)

r hr()

Variable Summary

summary(harv_est_all)

::::::

r fa("table") Compiled Effort Estimates

::::::{.indent}

data(effort_est_all, package = "KuskoHarvData")

:::{.describe} Each row represents one summary statistic (mean, standard deviation, lower/upper 95% confidence limits) of harvest for one species, in one geographic stratum, in one day. :::

Variable Descriptions

matrix(c(
  # VARIABLE                              # DESCRIPTION
  "date",        "The date to which the estimate applies",
  "stratum",     "The geographic stratum to which the estimate applies",
  "estimate",    "The estimated number of drift boat trips that occured in that stratum in that day."
), ncol = 2, byrow = TRUE) |> 
vars_table()

r hr()

View First 10 Rows

data_table(effort_est_all, head)

r hr()

View Last 10 Rows

data_table(effort_est_all, tail)

r hr()

Variable Summary

summary(effort_est_all)

::::::

r fa("table") Completed Trip Interviews

::::::{.indent}

data(interview_data_all, package = "KuskoHarvData")

:::{.describe} Each row represents one completed trip interview. :::

Variable Descriptions

matrix(c(
  # VARIABLE                     # DESCRIPTION
  "UID",                         "Unique identifer of the opener (`YYYY_MM_DD` format)",
  "source",                      "Interview data source (BBH = Bethel Boat Harbor, CBM = Community-Based Harvest Monitoring, FC = Bethel-area Fish Camps, ADFG = ADF&G Division of Subsistence Surveys)",
  "stratum",                     "Geographic stratum in which trip occurred (see the map)",
  "gear",                        "Gillnet type: drift for set",
  "net_length",                  "Length of gillnet (feet)",
  "mesh_size",                   "Gillnet stretched mesh size (inches)",
  "trip_start; trip_end",        "Fisher-reported departure/return times",
  "trip_duration",               "The time elapsed between `trip_start` and `trip_end`",
  "soak_duration",               "Fisher-reported time spent with net soaking",
  "chinook; chum; sockeye",      "Fisher-reported salmon harvest by species",
  "village",                     "Location of the interview",
  "suit_effort",                 "<sup>a</sup>Logical flag for whether all information is available for estimating effort.",
  "suit_cr_info",                "<sup>a</sup>Logical flag for whether all information is available for estimating catch rate (`fish/(soak_duration * net_length`))",
  "suit_cr_reliable",            "<sup>a</sup>Logical flag for whether data passed QA/QC checks for calculating catch rate",
  "suit_avg_soak",               "<sup>a</sup>Logical flag for whether soak duration data passed QA/QC checks",
  "suit_avg_net",                "<sup>a</sup>Logical flag for whether the net length data passed QA/QC checks",
  "note",                        "Auto-generated description of QA/QC issues identified"
), ncol = 2, byrow = TRUE) |> 

vars_table(footnote_args = list(alphabet = c("Complete details of QA/QC checks performed found [here](https://htmlpreview.github.io/?https://github.com/bstaton1/KuskoHarvEst/blob/main/inst/rstudio/templates/04-docs/06-data-checks.html).")))

r hr()

First 10 Rows

data_table(interview_data_all, head)

r hr()

Last 10 Rows

data_table(interview_data_all, tail)

r hr()

Variable Summary

summary(interview_data_all)

::::::

r fa("table") Aerial Drift Boat Counts

::::::{.indent}

data(flight_data_all, package = "KuskoHarvData")

:::{.describe} Each row represents one completed aerial survey. :::

Variable Descriptions

matrix(c(
  # VARIABLE                              # DESCRIPTION
  "UID",                                  "Unique identifer of the opener (`YYYY_MM_DD` format)",
  "flight",                               "N^th^ survey in day",
  "start_time; endtime",                  "Beginning and ending times of the survey",
  "A_drift; B_drift; C_drift; D1_drift",  "Count of drift boats in each geographic stratum (see the map)"
), ncol = 2, byrow = TRUE) |> 
vars_table()

r hr()

View First 10 Rows

data_table(flight_data_all, head)

r hr()

View Last 10 Rows

data_table(flight_data_all, tail)

r hr()

Variable Summary

summary(flight_data_all)

::::::

r fa("table") Bethel Test Fishery CPUE Records

::::::{.indent}

data(btf_data_all, package = "KuskoHarvData")

:::{.describe} Each row represents the daily catch-per-unit-effort (CPUE) for one species, each day of BTF operations (r paste(range(lubridate::year(btf_data_all$date)), collapse = "-")). Data are available from the Alaska Department of Fish and Game Bethel Test Fishery webpage -- see step 5 in vignette("updating-data", package = "KuskoHarvData") for details. :::

Variable Descriptions

matrix(c(
  # VARIABLE    # DESCRIPTION
  "date",       "Date of sampling",
  "species",    "Species for which the CPUE values apply",
  "cpue",       "Catch per unit effort (salmon &#183; fathom<sup>-1</sup> &#183; minute <sup>-1</sup>)",
  "ccpue",      "Cumulative CPUE; the sum of all daily CPUE values up to and including the value in the `date` column"
), ncol = 2, byrow = TRUE) |> 
vars_table()

r hr()

View First 10 Rows

data_table(btf_data_all, head)

r hr()

View Last 10 Rows

data_table(btf_data_all, tail)

r hr()

Variable Summary

summary(btf_data_all)

::::::

r fa("table") Daily PABE Weather Summaries

::::::{.indent}

data(PABE_data_all, package = "KuskoHarvData")

:::{.describe} Each row represents a daily summary statistic of a weather variable. Data were accessed via the 'reim' R package to query the ASOS database (airports), hosted by the Iowa State University Environmental Mesonet. The weather station used was the Bethel Airport ("PABE"). :::

Variable Descriptions

matrix(c(
  # VARIABLE                          # DESCRIPTION
  "date",                             "Date the data correspond to; only dates between June 1 and August 30 in years after and including 2016 are included",
  "mean_temp; min_temp; max_temp",    "Average, minimum, and maximum of all air temperature measurements for `date` (&deg;F)",
  "mean_relh",                        "Average of all relative humidity measurements for `date` (% of maximum)",
  "precip",                           "Sum of all precipitation measurements for `date` (inches)",
  "mean_Nwind",                       "Average of all wind speed measurements  for `date` (miles &#183; hour<sup>-1</sup>) after converting to northerly and easterly speed vectors. See `?KuskoHarvUtils::get_Nwind()` and `?KuskoHarvUtils::get_Ewind()` for details.",
  "mean_wind",                        "Average of all wind speed measurements for `date` (miles &#183; hour<sup>-1</sup>), regardless of direction",
  "max_gust",                         "Maximum of all gust measurements for `date`; gusts only register if they exceed 14 knots"
), ncol = 2, byrow = TRUE) |> 
vars_table()

r hr()

View First 10 Rows

data_table(PABE_data_all, head)

r hr()

View Last 10 Rows

data_table(PABE_data_all, tail)

r hr()

Variable Summary

summary(PABE_data_all)

::::::



bstaton1/KuskoHarvData documentation built on Aug. 15, 2024, 3:29 p.m.