Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions R/create_citation.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,22 @@
create_citation <- function(
authors = NULL,
title = "[TITLE]",
year = format(as.POSIXct(Sys.Date(), format = "%YYYY-%mm-%dd"), "%Y")
year = format(as.POSIXct(Sys.Date(), format = "%YYYY-%mm-%dd"), "%Y"),
type = NULL
) {
# Check if authors is input - improved from previous fxn so did not fail
if (is.null(authors) | any(authors == "")) {
if (tolower(type) == "sedar"){
citation <- paste0(
"{{< pagebreak >}} \n",
"\n",
"Please cite this publication as: \n",
"\n",
"SEDAR. ",
year, ". ",
title, ". SEDAR, North Charleston SC. \\pageref*{LastPage}{} pp."
)
} else {
cli::cli_alert_warning("Authorship not defined.")
cli::cli_alert_info("Did you forget to specify `authors`?")
# Define default citation - needs authors editing
Expand All @@ -35,7 +47,7 @@ create_citation <- function(
title, ". National Marine Fisheries Service, ",
"[CITY], [STATE]. \\pageref*{LastPage}{} pp."
)
} else {
} } else {
# Authored by Kelli Johnson in previous PR
author_data_frame <- data.frame(office = authors) |>
tibble::rownames_to_column("input") |>
Expand Down Expand Up @@ -141,7 +153,7 @@ create_citation <- function(
"\n",
"Please cite this publication as: \n",
"\n",
ifelse(primary_author_office[["office"]] == "SEFSC", "SEDAR.", author_list),
ifelse(primary_author_office[["office"]] == "SEFSC" | tolower(type) == "sedar", "SEDAR.", author_list),
" ", year, ". ",
glue::glue("{title}"), ". ",
region_specific_part,
Expand Down
20 changes: 16 additions & 4 deletions R/create_template.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
#'
#' Default: "sar" (a NOAA standard "Stock Assessment Report")
#'
#' Options: "sar" (Stock Assessment Report), "nemt" (Northeast Management Track), "pfmc" (Pacific Fishery Management Council), "safe" (Stock Assessment and Fishery Evaluation)
#' Options: "sar" (Stock Assessment Report), "nemt" (Northeast Management Track),
#' "pfmc" (Pacific Fishery Management Council), "safe" (Stock Assessment and
#' Fishery Evaluation), "sedar" (SouthEast Data, Assessment, and Review)
#'
#' @param office Regional Fisheries Science Center producing the report.
#'
Expand Down Expand Up @@ -265,21 +267,26 @@ create_template <- function(
"Pacific Fishery Management Council" = "pfmc",
"Stock Assessment and Fishery Evaluation" = "safe",
"Stock Assessment Report" = "skeleton",
"SouthEast Data, Assessment, and Review" = "sedar",
"SouthEast Data Assessment and Review" = "sedar",
"sar" = "skeleton",
"pfmc" = "pfmc",
"nemt" = "nemt",
"safe" = "safe",
"sedar" = "sedar",
"SEDAR" = "sedar",
{
type_fxn <- function() {
selection <- utils::menu(
title = "Unrecognized template type. Please select an option below: ",
choices = c("Default", "Pacific Fisheries Management Council", "Northeast Management Track", "SAFE")
choices = c("Default", "Pacific Fisheries Management Council", "Northeast Management Track", "SAFE", "SEDAR")
)
type <- switch(as.character(selection),
"1" = "skeleton",
"2" = "pfmc",
"3" = "nemt",
"4" = "safe",
"5" = "sedar",
{
"skeleton"
}
Expand Down Expand Up @@ -462,7 +469,9 @@ create_template <- function(

asar_folder <- system.file("templates", package = "asar")
# copy files from specific type folder
current_folder <- ifelse(rerender_skeleton, subdir, file.path(asar_folder, type))
current_folder <- ifelse(rerender_skeleton,
subdir,
file.path(asar_folder, type))
new_folder <- subdir

##### Identify files to copy ----
Expand Down Expand Up @@ -1115,7 +1124,10 @@ create_template <- function(
citation <- create_citation(
authors = authors,
title = title,
year = year
year = year,
type = ifelse(tolower(office) == "sefsc",
"sedar",
type)
)
cli::cli_alert_success("Added report citation.")
}
Expand Down
7 changes: 6 additions & 1 deletion R/create_yaml.R
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,12 @@ create_yaml <- function(
toad <- paste(author_list[[i]], sep = ",")
add_authors <- paste0(add_authors, toad) # -> add_authors
}
yaml <- paste0(yaml, add_authors)

sedar_author <- " - name: 'SEDAR'\n affiliations: \n address: '4055 Faber Place Drive, Suite 201' \n city: 'North Charleston' \n state: 'SC' \n postal-code: '29405' \n"

yaml <- ifelse(tolower(type) == "sedar",
paste0(yaml, sedar_author),
paste0(yaml, add_authors))

# Add other parts
yaml <- paste0(
Expand Down
3 changes: 2 additions & 1 deletion inst/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ This folder contains various files which support the creation of materials for r
* `preamble` R file used to extract key quantities from model results file used in asar report (`preamble.R`)
* Images of species used for asar report cover pages (`spp_img` folder)
* US Dept of Commerce logo placed on report title page (`us_doc_logo.png`)
* The `templates` sub-folder contains the child documents used for each report "type": Northeast management track (nemt); Pacific Fisheries Marine Council (pfmc); Stock Assessment and Fishery Evaluation (safe); standard report format (skeleton)
* The `templates` sub-folder contains the child documents used for each report "type": Northeast management track (nemt); Pacific Fisheries Marine Council (pfmc); Stock Assessment and Fishery Evaluation (safe); SouthEast Data, Assessment, and Review (sedar),
standard report format (skeleton)
2 changes: 2 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ SEFSC
SSC
SWA
SWFSC
SouthEast
Strikethrough
TOC
TinyTeX
Expand Down Expand Up @@ -119,6 +120,7 @@ roboto
saltatrix
sar
se
sedar
snakecase
socio
sso
Expand Down
15 changes: 15 additions & 0 deletions inst/templates/sedar/01_introduction.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Introduction {#sec-intro}


## Workshop Time and Place


## Terms of Reference


## List of Participants


## List of Working Papers and Reference Documents


68 changes: 68 additions & 0 deletions inst/templates/sedar/02_data_review.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Data Review and Update {#sec-data}


## Stock Structure and Management Unit


## Life History Parameters


### Morphometric and Conversion Factors


### Age and Growth


### Natural Mortality


### Maturity


### Sexual Transition


### Fecundity


### Discard Mortality


## Fishery-Dependent Data


### Commercial Landings


### Recreational Landings


### Commercial Discards


### Recreational Discards


### Commercial Size Composition


### Recreational Size Composition


### Commercial Age Composition


### Recreational Age Composition


### Commercial Catch Per Unit of Effort Indices of Abundance


### Recreational Catch Per Unit of Effort Indices of Abundance


## Fishery-Independent Surveys


## Environmental Considerations and Contributions from Stakeholders

70 changes: 70 additions & 0 deletions inst/templates/sedar/03_model-configuration.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Stock Assessment Model Configuration {#sec-mod-config}

## Model Configuration


### Initial Conditions


### Temporal Structure


### Spatial Structure


### Life History


### Recruitment Dynamics


### Fleet Structure and Surveys


### Selectivity


### Retention


### Landings and Associated Length and Age Compositions


### Discards and Associated Length Compositions


### Indices


## Goodness of Fit and Assumed Error Structure


## Estimated Parameters


## Model Diagnostics


### Residual Analysis


### Correlation Analysis


### Profile Likelihoods


### Jitter Analysis


### Retrospective Analysis


### Jack-knife Analysis on Indices of Abundance


### Additional Diagnostics


## Sensitivity Runs

55 changes: 55 additions & 0 deletions inst/templates/sedar/04_model-results.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Stock Assessment Model Results {#sec-model-results}

## Estimated Parameters


## Fishing Mortality


## Selectivity


## Recruitment


## Biomass and Abundance Trajectories


## Model Fit and Residual Analysis


### Landings


### Discards


### Indices


### Length Compositions


### Age Compositions

## Model Diagnostics

### Correlation Analysis


### Profile Likelihoods


### Jitter Analysis


### Retrospective Analysis


### Bridging Analysis


### Sensitivity Model Runs



3 changes: 3 additions & 0 deletions inst/templates/sedar/05_discussion.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Discussion {#sec-discussion}

<!--- The discussion is dependent on analyst/assessment/region. Include subsections discussing ecosystem considerations (if applicable) and research recommendations/improvements to the assessment. --->
19 changes: 19 additions & 0 deletions inst/templates/sedar/06_projections.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Projections {#sec-projections}

## Introduction


## Projection Methods


## Projection Results


### Biological Reference Points


### Stock Status


### Overfishing Limit and Acceptable Biological Catch Projections

7 changes: 7 additions & 0 deletions inst/templates/sedar/07_acknowledgments.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Acknowledgements {#sec-acknowledgements}



<!--- Please leave in the following: --->

This document was produced using the R package asar [@asar_2026], which is free to use and publicly available on [GitHub](https://github.com/nmfs-ost/asar).
4 changes: 4 additions & 0 deletions inst/templates/sedar/08_references.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# References {#sec-refs}

::: {#refs}
:::
9 changes: 9 additions & 0 deletions inst/templates/sedar/11_appendix.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
\appendix
\setcounter{figure}{0}
\setcounter{table}{0}

# Appendices {#sec-appendix}

<!---
Any information relevant for evaluation of the stock either during SSC or management review should be included in the appendix. The main assessment document should contain the minimum necessary information to inform and provide management advice for the stock while additional materials can be found in the appendix.
--->
Loading
Loading