Skip to content

Commit

Permalink
ok maybe this will work.
Browse files Browse the repository at this point in the history
  • Loading branch information
okenk committed Nov 8, 2024
1 parent a446b82 commit d961135
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 15 deletions.
33 changes: 22 additions & 11 deletions R/data_summary_doc.qmd → docs/data_summary_doc.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ title: "Data summary"
format:
html:
toc: true
output-file: "index"
editor: visual
---

```{r opts, echo = FALSE, include = FALSE, warning = FALSE, message = FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
library(here)
Expand All @@ -13,6 +15,7 @@ library(ggplot2)
```

## Commercial landings

```{r, cache=TRUE}
load(here('data/confidential/PacFIN.YTRK.CompFT.09.Oct.2024.RData'))
Expand All @@ -32,6 +35,7 @@ yt.n.catch |>
```

### Washington

```{r}
filter(yt.n.catch, AGENCY_CODE == 'W') |>
group_by(LANDING_YEAR) |>
Expand All @@ -40,18 +44,20 @@ filter(yt.n.catch, AGENCY_CODE == 'W') |>
```

WDFW has alerted the STAT these do not include all tribal catches in recent years. Tribal catches are:

```{r}
filter(yt.n.catch, AGENCY_CODE == 'W', PARTICIPATION_GROUP_NAME == "TREATY INDIAN COMMERCIAL FISHER") |>
group_by(LANDING_YEAR) |>
summarise(catch_mt = sum(LANDED_WEIGHT_MTONS)) |>
knitr::kable(align = 'l', digits = 1)
```


### Oregon

These were provided directly to the STAT

### California

```{r}
filter(yt.n.catch, AGENCY_CODE == 'C') |>
group_by(LANDING_YEAR) |>
Expand All @@ -66,6 +72,7 @@ Note this is for catch landed into Del Norte and Humboldt counties only.
### Washington

Modern catches:

```{r}
wa_modern <- readr::read_csv(here('Data/Raw_not_confidential/RecFIN_WA_catch_to_2023.csv')) |>
filter(RECFIN_WATER_AREA_NAME != 'Canada', RECFIN_YEAR < 2023)
Expand All @@ -74,13 +81,13 @@ wa_modern |> group_by(RECFIN_YEAR) |>
knitr::kable(align = 'l', digits = 1)
```

Questions:

Questions:

1. There are three values for `RECFIN_WATER_AREA_NAME`: Estuary, Ocean, and Canada. Which should be included? Above table excludes Canada.
2. 2023 has a number of instances where `RECFIN_WEEK` is zero, and one instance where is it missing. In the instance where it is missing, there is no estimate of catch in mt.
1. There are three values for `RECFIN_WATER_AREA_NAME`: Estuary, Ocean, and Canada. Which should be included? Above table excludes Canada.
2. 2023 has a number of instances where `RECFIN_WEEK` is zero, and one instance where is it missing. In the instance where it is missing, there is no estimate of catch in mt.

Historical catches:

```{r}
wa_historical <- readr::read_csv(here('Data/Raw_not_confidential/WA_historical_rec.csv'))
Expand All @@ -89,10 +96,13 @@ wa_historical |>
summarise(Dead_Catch_num = sum(RETAINED_NUM)) |>
knitr::kable(align = 'l', digits = 1)
```

### Oregon

These were provided directly to the STAT

### California

```{r}
ca_modern <- readr::read_csv(here('Data/Raw_not_confidential/RecFIN_CA_catch_to_2023.csv')) |>
filter(DISTRICT_NAME == "Redwood (Humboldt County, Except Shelter Cover Area, And Del Norte County)" )
Expand All @@ -103,19 +113,19 @@ ca_modern |>
```

Note that 2020 proxy catches are missing, and we will need historical recreational catches that are not on RecFIN.

## Commercial length data

Initial sample sizes after running `PacFIN.Utilities::cleanPacFIN()`:

```{r, cache=TRUE}
load(here('Data/Confidential/PacFIN.YTRK.bds.09.Oct.2024.RData'))
bds.clean <- bds.pacfin |>
filter(AGENCY_CODE == 'W' | AGENCY_CODE == 'O' | PACFIN_GROUP_PORT_CODE == 'CCA' |
PACFIN_GROUP_PORT_CODE == 'ERA') |>
PacFIN.Utilities::cleanPacFIN(verbose = FALSE)
bds.clean <- PacFIN.Utilities::cleanPacFIN(bds.pacfin, verbose = FALSE)
bds.clean |>
filter(state == 'WA' | state == 'OR' | PACFIN_GROUP_PORT_CODE == 'CCA' |
PACFIN_GROUP_PORT_CODE == 'ERA') |>
filter(year < 2024) |>
group_by(state, year) |>
summarise(n_length = sum(!is.na(length))) |>
Expand All @@ -124,6 +134,7 @@ bds.clean |>
knitr::kable(align = 'l', digits = 1)
```

Note that California lengths are not yet available for 2023.

While running `PacFIN.Utilities::cleanPacFIN()`, it noted that 20 Washington ages in 1991 were double read, the second reader was not recorded, the first and second ages differed, and no final age was determined.
While running `PacFIN.Utilities::cleanPacFIN()`, it noted that 20 Washington ages in 1991 were double read, the second reader was not recorded, the first and second ages differed, and no final age was determined.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -976,18 +976,18 @@ <h3 class="anchored" data-anchor-id="california-1">California</h3>
<section id="commercial-length-data" class="level2">
<h2 class="anchored" data-anchor-id="commercial-length-data">Commercial length data</h2>
<p>Initial sample sizes after running <code>PacFIN.Utilities::cleanPacFIN()</code>:</p>
<div class="cell" data-hash="data_summary_doc_cache/html/unnamed-chunk-8_de91b53e460aa9305db075b860b3a25b">
<div class="cell" data-hash="data_summary_doc_cache/html/unnamed-chunk-8_56a9eedcf02221b3580e605bc40aa3c8">
<div class="cell-output cell-output-stdout">
<pre><code> AGE_METHOD1 AGE_METHOD2 AGE_METHOD3 Age method for best age n
1 B B B B 2346
2 B B &lt;NA&gt; 1
3 B B &lt;NA&gt; B 4373
4 B &lt;NA&gt; &lt;NA&gt; 32
5 B &lt;NA&gt; &lt;NA&gt; B 134303
5 B &lt;NA&gt; &lt;NA&gt; B 138673
6 L &lt;NA&gt; &lt;NA&gt; L 3
7 S &lt;NA&gt; &lt;NA&gt; S 17942
8 T &lt;NA&gt; &lt;NA&gt; T 2
9 &lt;NA&gt; &lt;NA&gt; &lt;NA&gt; &lt;NA&gt; 70424</code></pre>
9 &lt;NA&gt; &lt;NA&gt; &lt;NA&gt; &lt;NA&gt; 82589</code></pre>
</div>
<div class="cell-output-display">
<table class="table table-sm table-striped">
Expand Down Expand Up @@ -1340,7 +1340,7 @@ <h2 class="anchored" data-anchor-id="commercial-length-data">Commercial length d
</table>
</div>
</div>
<p>Note that California lengths are not available for 2023.</p>
<p>Note that California lengths are not yet available for 2023.</p>
<p>While running <code>PacFIN.Utilities::cleanPacFIN()</code>, it noted that 20 Washington ages in 1991 were double read, the second reader was not recorded, the first and second ages differed, and no final age was determined.</p>
</section>

Expand Down
Binary file removed docs/index_files/figure-html/opts-1.png
Binary file not shown.

0 comments on commit d961135

Please sign in to comment.