diff --git a/DESCRIPTION b/DESCRIPTION index c5380df3..96231fa0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -50,3 +50,6 @@ Config/testthat/parallel: true Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.2 +Depends: + R (>= 2.10) +LazyData: true diff --git a/R/create_template.R b/R/create_template.R index 5bc4c8e4..efb572c6 100644 --- a/R/create_template.R +++ b/R/create_template.R @@ -651,12 +651,17 @@ create_template <- function( # print("_______Standardized output data________") - # Add in quantities and data R chunk - params_chunk <- add_chunk( - glue::glue( - "output <- read.csv('", resdir, "/", model_results, "') \n \n", - "# Reference quantities \n", - "# sbtgt \n" + # Add preamble + # add in quantities and output data R chunk + preamble <- add_chunk( + paste0( + "output <- utils::read.csv('", + ifelse(convert_output, + paste0(subdir, "/", species, "_", "_std_res_", year, ".csv"), + paste0(resdir, "/", model_results)), "') \n", + "# Call reference points and quantities below \n", + "# sbmsy = 10000 \n", + "# fmsy = 0.3 \n" ), label = "output_and_quantities" ) @@ -784,7 +789,7 @@ create_template <- function( # Combine template sections report_template <- paste( yaml, - params_chunk, + preamble, citation, sections, sep = "\n" @@ -940,7 +945,7 @@ create_template <- function( # Combine template sections report_template <- paste( yaml, - # ass_output, + # preamble, citation, sections, sep = "\n" diff --git a/README.md b/README.md index 7cc7ada7..c8bfc430 100644 --- a/README.md +++ b/README.md @@ -30,25 +30,43 @@ remotes::install_github("nmfs-ost/satf") ## Example -The following is a basic example to render a stock assessment report for a particular region in the U.S.: +The following code will allow the user to replicate the [2023 petrale sole stock assessment](https://www.pcouncil.org/documents/2024/02/status-of-petrale-sole-eopsetta-jordanialong-the-u-s-west-coast-in-2023.pdf/) produced by the NWFSC and made available by the Pacific Fisheries Management Council. The assessment model files are also available on the PFMC's website. A (DRAFT) tutorial for using `asar` can be found [here](https://connect.fisheries.noaa.gov/asar_tutorial/). + +The SS3 Report.sso files was converted using the following code: + +```r +asar::convert_output( + output_file = "Report.sso", + outdir = "data", + model = "ss3", + file_save = TRUE, + save_name = "petrale_convert_output") +``` + +In this function, the users have the option to convert output files to a standardized framework from either SS3 (Report.sso) or BAM (.rdat) output files. The converted output was saved as an Rdata file and can be found in the example folder in this repository. + +To proceed, the user should then run the following: ```r asar::create_template( - new_template = TRUE, format = "pdf", office = "NWFSC", - species = "Dover sole", - spp_latin = "Pomatomus saltatrix", - year = 2010, - author = c("John Snow", "Danny Phantom", "Patrick Star"), + region = "U.S. West Coast", + species = "Petrale sole", + spp_latin = "Eopsetta jordani", + year = 2023, + author = c("Ian G. Taylor", "Vladlena Gertseva", "Nick Tolimieri"), include_affiliation = TRUE, - resdir = "C:/Users/Documents/Example_Files", - model_results = "Report.sso", + simple_affiliation = FALSE, + param_names = c("nf","sf"), + param_values = c("North fleet", "South fleet"), + resdir = "data", + model_results = "Petrale_sole_std_res_2023.csv", model = "SS3" ) ``` -Note: This is only an example. The parameters in the example do not convey accurate stock assessment information. +Note: The output of this report is an example based on a real stock assessment. Please refer to the link in the beginning of this section for the full assessment report. ## Testing @@ -65,14 +83,13 @@ This is a modularized template, there is no need to make any edits to the skelet - Executive Summary - Introduction - Data -- Modeling Approach -- Results -- Projections +- Assessment - Discussion - Acknowledgments - References - Tables - Figures +- Appendix Please leave an issue for any bugs or suggestions to improve the package during testing on the [Issues Page](https://github.com/Schiano-NOAA/ASAR/issues). Please remember that this package is currently in development and we do not project to release version 1.0 until December 2024. Thank you for helping us improve this package! diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index 97397a74..c5286681 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -1,20 +1,57 @@ url: nmfs-ost.github.io/asar/ -template: - bootstrap: 5 +navbar: + structure: + left: + - home + - reference + - sourcecode + - tutorial + - articles + - documents + - news + right: + - issue + - github -development: - mode: auto + components: + home: + icon: fas fa-home fa-lg + href: index.html -home: - title: Automated Stock Assessment Reporting + reference: + text: Functions + icon: far fa-file-code fa-lg + href: reference/index.html -reference: + sourcecode: + text: Source Code + icon: fab fa-github fa-lg + href: https://github.com/nmfs-ost/asar -articles: -- title: Manual - contents: - - manual - - regional_workflows - - markdown_notation + issue: + text: Issues + icon: fas fa-question-circle fa-lg + href: https://github.com/nmfs-fish-tools/pkgdownTemplate/issues/ + articles: + text: Articles + icon: fas fa-file-contract fa-lg + menu: + - text: Manual + href: articles/manual.html + - text: Markdown Notation + href: articles/markdown_notation.html + - text: Regional Workflows + href: articles/regional_workflows.html + + documents: + text: References + icon: fas fa-book fa-lg + menu: + - text: Petrale Example + href: SAR_USWC_Petrale_sole_skeleton.pdf + + tutorial: + text: Tutorial + href: https://connect.fisheries.noaa.gov/asar_tutorial/