Skip to content

Working with the FSAR template

Sean Anderson edited this page Jul 19, 2023 · 11 revisions

The FSAR template is still in early development within csasdown. The template takes a set of R Markdown files, creates a .docx version of an FSAR with meta-data such as the title, report number, region, and regional CSA address and content derived from rendering the R Markdown files.

The use case is for individuals who already have their Research Document in csasdown (or in other R or R Markdown files) and wish to use that code to draft a reproducible FSAR.

Although it's likely possible to take a csasdown FSAR to completion entirely from R Markdown files, a user may also choose at some point to start editing the .docx file and track changes as they circulate the document amongst contributors and participants of the CSAS meeting.

Steps to work through an example

  1. Install csasdown (with the 'fsar' branch for now):
install.packages("remotes")
remotes::install_github("pbs-assess/csasdown", ref = "fsar")
  1. Navigate to a folder where you want to keep the FSAR files. If you want, you can follow along with a temporary folder:
testing_path <- file.path(tempdir(), "fsar-test")
dir.create(testing_path)
setwd(testing_path)
  1. Create a draft FSAR:
csasdown::draft("fsar")
  1. Navigate to that folder in your file system and open the fsar-test.Rroj (or otherwise named) RStudio project. You can open the folder quickly with:
browseURL(".")
  1. Within the RStudio project, open the file index.Rmd. Render the document by clicking the 'Knit' button in RStudio or running:
csasdown::render_sar()
  1. Now look in the _book folder for the file fsar.docx and open that in MS Word to read it.
browseURL("_book")
  1. Close the MS Word file. Try editing the file 01_fsar.Rmd and index.Rmd, re-knitting, and opening the .docx file again.

Continue as needed. At any point you can choose to stop updating the .docx from the .Rmd files and continue editing within the .docx file.

Screenshots and previews

The .docx file:

image image

The meta-data section to edit:

---
report_title: "Fish stock name"
report_year: "2022"
release_month: "January"
report_number: "044"
meeting_date: "January 25, 2022"
region: "Pacific Region"
phone: "(555) 555-5555"
email: "email@csa-email.com"
csa_address: "CSA Address goes here"
report_title_french: "Fish stock name"
inuktitut_citation: "Inuktitut citation here"
context: |
  Here is the context text. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Example of content to edit

## SUMMARY {-}

### Fish stock name {-}

Text here

### Science Advice {-}

Text here

## BASIS FOR ASSESSMENT {-}

### Year assessment approach was approved {-}

### Assessment Type {-}

### Most Recent Assessment Date {-}

1.	Last Full Assessment: date and reference
2.	Last Interim Year Update: date and reference

Still to do

  • Update the included .docx template
  • Fill in the remaining sections of content
  • Refine the example figures and pull them out so they can be referenced elsewhere.
  • Make the template use the included styles for bullets, captions, and tables.