Create Stock Assessment Report Template. To see templates included in the base skeleton, please run 'list.files(system.file('templates','skeleton', package = 'asar'))' in the console.
Source:R/create_template.R
create_template.Rd
Create Stock Assessment Report Template. To see templates included in the base skeleton, please run 'list.files(system.file('templates','skeleton', package = 'asar'))' in the console.
Usage
create_template(
new_template = TRUE,
format = c("pdf", "docx", "html", NULL),
office = c("AFSC", "PIFSC", "NEFSC", "NWFSC", "SEFSC", "SWFSC"),
region = NULL,
complex = "NO",
species = NULL,
spp_latin = NULL,
year = NULL,
author = "",
add_author = NULL,
include_affiliation = FALSE,
simple_affiliation = TRUE,
alt_title = FALSE,
title = NULL,
parameters = TRUE,
param_names = NULL,
param_values = NULL,
resdir = NULL,
model_results = NULL,
model = NULL,
new_section = NULL,
section_location = NULL,
type = "SAR",
prev_year = NULL,
custom = FALSE,
custom_sections = NULL,
include_figures = TRUE,
include_tables = TRUE,
add_image = FALSE,
spp_image = NULL
)
Arguments
- new_template
TRUE/FALSE; default is false otherwise if true, will pull the last saved stock assessment report skeleton
- format
File type for the render (i.e. pdf, docx, html)
- office
Regional fisheries science center producing the report (AFSC, NEFSC, NWFSC, PIFSC, SEFSC, SWFSC)
- region
Full name of region in which the species is evaluated if applicable; Note: if this is not specified for your center or for the species, do not use this variable.
- complex
Is this a species complex? "YES" or "NO"
- species
Full common name for target species, split naming by a space and capitalize first letter(s)
- spp_latin
Latin name for the target species of this assessment
- year
Year the assessment is being conducted, default is current year report is being rendered
List of authors to include in the assessment; keep authorship order
temporarily add an author that is not currently in the database. Follow the format of "First MI Last". Please leave a comment on the github issues page to be added.
- include_affiliation
TRUE/FALSE; does the analyst want to include affiliations of the authors in the document?
- simple_affiliation
If including affiliation, adding just office name rather than full address; TRUE/FALSE, default is TRUE
- alt_title
TRUE/FALSE create an alternative title than the default
- title
Name of new title if default is not appropriate; Example, "Management Track Assessments Spring 2024"
- parameters
TRUE/FALSE; default TRUE - for parameterization of the script
- param_names
List of parameter names that will be called in the document; parameters automatically included are office, region, and species listed in function parameters
- param_values
List of values associated with the order of parameter names; parameters automatically included are office, region, and species listed in function parameters
- resdir
Directory where the model results file(s) are located
- model_results
Name of the model results file
- model
Type of assessment model that was used to assess the stock (i.e. "BAM", "SS3", "AMAK", "ASAP", ect)
- new_section
File name of the new section
- section_location
Location where the section should be added relative to the base skeleton document
- type
Type of report to build - default is SAR
- prev_year
Year that previous assessment report was conducted in - for pulling previous assessment template
- custom
TRUE/FALSE Build custom sectioning for the template rather than the default for stock assessments in your region
- custom_sections
List of the sections you want to include in the custom template. Note: this only includes sections within 'templates' > 'skeleton'. The section name can be used such as 'abstract' rather than the entire name '00_abstract.qmd'. If a new section is to be added, please also use parameters 'new_section', and 'section_location'
- include_figures
Determine if figures are included into the report
- include_tables
Indicate if tables are included into the report
- add_image
add outside image of species to the template
- spp_image
full directory and species image name to direct the program where to find and extract the image
Value
Create template and pull skeleton for a stock assessment report. Function builds a YAML specific to the region and utilizes current resources and workflows from different U.S. Fishery Science Centers. General sections are called as child documents in this skeleton and each of the child documents should be edited separately.
Examples
create_template()
#> Warning: Results file or model name not defined.
#> Warning: Results file or model name not defined.
#> [1] "__________Built YAML Header______________"
#> Authorship is not defined.
#> [1] "_______Add Report Citation________"
#> [1] "___Created report template______"
#> Saved report template in directory: ~/stock_assessment_reports/report
#> To proceeed, please edit sections within the report template in order to produce a completed stock assessment report.