Skip to content

Commit

Permalink
longtable issue
Browse files Browse the repository at this point in the history
Started changing lontable = FALSE, messed up on .tex files though
  • Loading branch information
melissamonk-NOAA committed Mar 9, 2024
1 parent 3950c3c commit c420a3d
Show file tree
Hide file tree
Showing 48 changed files with 4,948 additions and 4,290 deletions.
2,164 changes: 279 additions & 1,885 deletions documents/_main.tex

Large diffs are not rendered by default.

35 changes: 0 additions & 35 deletions documents/nca/00a.md

This file was deleted.

6 changes: 6 additions & 0 deletions documents/nca/00bibliography.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
bibliography:
- sa4ss.bib
- wcassess.bib
- pfmcassess.bib
---
8 changes: 4 additions & 4 deletions documents/nca/52tables.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ col_names = c("Year", "Commercial Dead", "Commercial Live", "CPFV", "PR", "Total
table_format(x = out,
caption = "Removals (mt) by fleet and the summed total landings (mt).",
label = "allcatches",
longtable = FALSE, label = "allcatches",
digits = 1,
align = 'l',
col_names = col_names)
Expand Down Expand Up @@ -149,7 +149,7 @@ col_names <- c("Year", "Source", "Number of Ages")
sa4ss::table_format(x = tab,
caption = "Available age data by year and source used in the growth fleets.",
label = "growth-age-samps",
longtable = FALSE, label = "growth-age-samps",
align = 'l',
col_names = col_names,
custom_width = TRUE,
Expand All @@ -172,7 +172,7 @@ col_names <- c("Year", "UCSC Raw Count", "UCSC Filtered Count", "UCSB Raw Count"
table_format(x = tab,
caption = "All and filtered observations by year and sampling institution for PISCO.",
label = "pisco-data",
longtable = FALSE, label = "pisco-data",
align = 'l',
col_names = col_names)
```
Expand Down Expand Up @@ -275,7 +275,7 @@ col_names <- c("Fleet", "Data Type", "Francis", "MI", "Dirichlet")
sa4ss::table_format(x = tab,
caption = "Suggested data weights for each data weighting methodology by fleet and data type.",
label = "dw",
longtable = FALSE, label = "dw",
align = 'l',
digits = 2,
col_names = col_names)
Expand Down
82 changes: 21 additions & 61 deletions documents/nca/62appendix_crfs_onboard.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ or the history of regulation changes section for details.
The filters also included removal of the number of observed anglers and time fished at the tail
ends of the distributions and removal of drifts occurring in depths outside copper rockfish's range
(Table \@ref(tab:onboard-filter) and Figure \@ref(fig:onboard-depths)).
We retained 17,458 drifts for index
standardization, and 3,303 of those drifts encountered copper rockfish
We retained 17,458 drifts for index standardization, and 3,303 of those drifts encountered copper rockfish
Table \@ref(tab:onboard-percentpos).

We modeled catch per angler minutes fished (CPUE) by fishing drift.
Expand All @@ -65,17 +64,16 @@ known area of rocky substrate to areas in southern California that lack substrat
expansion of the estimated rocky substrate assumes that the proportions of rocky substrate within
and outside state waters are similar. Copper rockfish are a nearshore species and the majority of
observed encounters were within state waters (Table \@ref(tab:onboard-waterarea)).
This is, of course, an estimation of the amount of rocky substrate, and represents the best available data. The calculations can be found in the online supplementary material. Starting in 2017, depth restrictions eased in districts
This is, of course, an estimation of the amount of rocky substrate, and represents the best available data.
The calculations can be found in the online supplementary material. Starting in 2017, depth restrictions eased in districts
north of Point Conception and the recreational fleet targeted these depths
(Figure \@ref(fig:onboard-depths)). The deeper waters (40-50 fm) are
outside of the mapped hard bottom habitat, but could be assigned to the larger
areas considered as a factor in the index.


The covariates explored for model selection included year and four categorical region levels (CRFS Districts 3-6), a categorical variable for month, and continuous depth and depth-squared. Trends in the average CPUE by region were similar in the filtered data set (Figure \@ref(fig:onboard-regioncpue)). A year and region interaction
was included after visualizing the trends in average CPUE over time, but was not significant. The full model was selected by AICc and
included year, depth, depth squared and region
(Table \@ref(tab:onboard-model_selection)).
The covariates explored for model selection included year and four categorical region levels (CRFS Districts 3-6), a categorical variable for month, and continuous depth and depth-squared. Trends in the average CPUE by region were similar in the filtered data set (Figure \@ref(fig:onboard-regioncpue)). A year and region interaction was included after visualizing the trends in average CPUE over time, but was not significant. The full model was selected by AICc and
included year, depth, depth squared and region (Table \@ref(tab:onboard-model_selection)).

Indices were fit via MLE from the sdmTMB package in R. The Q-Q plot for the negative binomial model indicated a poor fit to the data, which as not surprising given the low percent of observed drifts encountering copper rockfish. A delta-Lognormal
was selected over a delta-gamma by a delta AIC of 487. The Q-Q plot indicated a much
Expand All @@ -85,19 +83,19 @@ and Figure \@ref(fig:onboard-index)).


```{r, results = 'asis'}
ind <- read.csv(file.path(data_dir, "rec_indices", "crfs_cpfv_onboard", "north", "start2004",
"keep_discard_prop.csv")) %>%
library(dplyr)
ind <- read.csv(file.path(data_dir, "rec_indices", "crfs_cpfv_onboard", "north", "start2004", "keep_discard_prop.csv")) %>%
mutate(Proportion.discarded = round(Proportion.discarded, 3)) %>%
mutate(Proportion.discarded = scales::percent(Proportion.discarded))
col_names = c("Year", "Number Kept", "Number Discarded", "Proprtion Discarded")
sa4ss::table_format(x = ind,
caption = "Number of observed copper rockfish retained and discarded by year.",
label = "onboard-keepdiscard",
longtable = FALSE, label = "onboard-keepdiscard",
col_names = col_names)
```

\newpage


```{r, results = 'asis'}
ind <- read.csv(file.path(data_dir, "rec_indices", "crfs_cpfv_onboard", "north",
Expand All @@ -108,12 +106,12 @@ col_names = c("District", "Inside State Waters", "Outside State Waters","Percent
sa4ss::table_format(x = ind,
caption = "Number of observed drifts inside and outside of state waters by district, summed across years.",
label = "onboard-waterarea",
longtable = FALSE, label = "onboard-waterarea",
col_names = col_names)
```


\newpage


```{r, results = 'asis'}
ind <- read.csv(file.path(data_dir, "rec_indices", "crfs_cpfv_onboard", "north",
Expand All @@ -123,41 +121,23 @@ col_names = c("Year", "Samples with Target", "Samples without Target", "Total Sa
sa4ss::table_format(x = ind,
caption = "Number of samples with and without copper rockfish.",
label = "onboard-percentpos")#,
# col_names = col_names)
```

\newpage

```{r, results = 'asis'}
#ind <- read.csv(file.path(data_dir, "rec_indices", "crfs_cpfv_onboard", "north",
# "model_selection.csv"))
#col_names = c("Filter", "Description", "Number of Samples", "Positive Samples")
#sa4ss::table_format(x = ind,
# caption = "Data filtering steps for the onboard CPFV survey.",
# label = "onboard-filter",
# col_names = col_names)
longtable = FALSE, label = "onboard-percentpos")
```


\newpage

```{r, results = 'asis'}
ind <- read.csv(file.path(data_dir, "rec_indices", "crfs_cpfv_onboard", "north", "start2004",
"deltalogn", "index_forSS.csv"))
ind <- ind[, c(1,4,5)]
col_names = c("Year", "Estimate", "logSE")
sa4ss::table_format(x = ind,
caption = "Estimated relative index of abundance for the onboard CPFV survey.",
label = "onboard-index",
longtable = FALSE, label = "onboard-index",
digits = 4,
col_names = col_names)
```

\newpage

```{r, results = 'asis'}
ind <- read.csv(file.path(data_dir, "rec_indices", "crfs_cpfv_onboard", "north", "start2004",
Expand All @@ -168,7 +148,7 @@ col_names = c("Filter", "Description", "Number of Samples", "Positive Samples")
sa4ss::table_format(
x = ind,
caption = "Data filtering steps for the onboard CPFV survey.",
label = "onboard-filter",
longtable = FALSE, label = "onboard-filter",
col_names = col_names,
landscape = TRUE,
custom_width = TRUE,
Expand All @@ -177,58 +157,40 @@ sa4ss::table_format(
width = c("8cm"))
```

\newpage

```{r, results = 'asis'}
ind <- read.csv(file.path(
data_dir, "rec_indices", "crfs_cpfv_onboard", "north", "start2004", "model_selection.csv"
))
col_names <- c("Intercept", "Depth", "Depth-squared", "Month", "Region", "Year", "DF", "AICc", "Delta AICc")
#sa4ss::table_format(
# x = ind,
# caption = "Model selection for the onboard CRFS CPFV survey.",
# label = "onboard-model_selection",
# digits = 2,
# font_size = 8,
# col_names = col_names
#)
```

\newpage
```{r, results = 'asis'}
sa4ss::add_figure(
filein = file.path(data_dir, "rec_indices", "crfs_cpfv_onboard", "north", "start2004",
"deltalogn", "index.png"),
caption = "Index for the onboard CPFV survey.",
alt_caption = "Index for the CPFV survey indicating a flat index until 2016 when the relative index indreases.",
alt_caption = "Index for the CPFV survey indicating a flat index until 2016 when the relative index indreases",
label = 'onboard-index')
```

\newpage


```{r, results = 'asis'}
sa4ss::add_figure(
filein = file.path(data_dir, "rec_indices", "crfs_cpfv_onboard", "north", "start2004",
"deltalogn", "qq.png"),
caption = "Q-Q plot for the onboard CPFV survey.",
alt_caption = "The q q plot shows a decent fit to the data.",
alt_caption = "The q q plot shows a decent fit to the data",
label = 'onboard-qq')
```

\newpage



```{r, results = 'asis'}
sa4ss::add_figure(
filein = file.path(data_dir, "rec_indices", "crfs_cpfv_onboard", "north", "start2004",
"average_cpue_by_district.png"),
caption = "Average CPUE by district prior to standardization.",
alt_caption = "Average CPUE by district whosing that the trends across district are similar.",
alt_caption = "Average catch per unit effort by district showing that the trends across district are similar",
label = 'onboard-regioncpue')
```

\newpage

```{r, results = 'asis'}
sa4ss::add_figure(
Expand All @@ -239,16 +201,14 @@ alt_caption = "Distribution of depths showing an increase in the mean as you mov
label = 'onboard-depths')
```

\newpage



```{r, results = 'asis'}
sa4ss::add_figure(
filein = file.path(data_dir, "rec_indices", "crfs_cpfv_onboard", "north", "start2004",
"drifts_by_depth_district.png"),
caption = "Depths of observed copper rockfish by district.",
alt_caption = "Number of drifts with copper rockfish by depth indicating copper rockfish are mostly found shallower than 300 feet.",
alt_caption = "Number of drifts with copper rockfish by depth indicating copper rockfish are mostly found shallower than 300 feet",
label = 'onboard-depths2')
```

\newpage
Loading

0 comments on commit c420a3d

Please sign in to comment.