Repository for an R Markdown (Rmd) Template for Automating U.S. Fish and Wildlife Service Weir Data Series Reports
Author: James K. Boersma
Point of Contact: James Boersma ([email protected])
Repository Type: R Markdown template
Year of Origin: 2025
Version: 1.0.0
DOI: Not available
Boersma JK. 2025.
Repository for an R Markdown template for automating U.S. Fish and Wildlife Service Weir Data Series Reports.
U.S. Fish and Wildlife Service, Kenai Field Office software release. Soldotna, Alaska.
- James K. Boersma: 0009-0000-6098-1160
This repository provides a reproducible R Markdown template for automating U.S. Fish and Wildlife Service (USFWS) Data Series Reports for weir monitoring projects. The template automates:
- Estimation of missing fish passage
- Stratified age-sex-length (ASL) composition summaries
- Integration of formatted maps, tables, and figures
The output is a Microsoft Word document styled using a USFWS-compliant .docx template.
Users should customize the Rmd, bib, functions, Map, and Code directories to fit their specific project needs.
| File/Folder | Description |
|---|---|
README.md |
This file. |
LICENSE.md |
Generic USFWS license. |
DISCLAIMER.md |
Standard USFWS disclaimer. |
.csl |
Citation style files for formatting references. |
template.docx |
Word template for formatting USFWS Data Series Reports. |
Data-series-template.docx |
Example compiled output. |
Data series template.rmd |
Main R Markdown file. Users should edit this. |
Code/ |
R scripts for missing passage and ASL estimation. |
Data/ |
Tidy CSVs containing raw passage and ASL data. |
functions/ |
R helper functions for plots, tables, maps, and text. Customizable. |
images/ |
Static images, logos, or photos. |
Map/ |
Shapefiles for adding spatial detail to maps. |
Output/ |
Generated outputs (e.g., CSV summaries). |
Python313/ |
Python tools for reference updates and .docx post-processing. |
renv.lock, renv/ |
Reproducible R environment using renv. |
references.bib |
BibTeX reference file. Users should edit this. |
updated_refs.py |
Python script to retrieve citations from DOIs. |
temp_docx/ |
Temporary .docx folder for header/footer/alt text updates. |
Date: Julian date of samplingAge: European-style format (e.g., 2.1 means total age = 2 + 1 + 1 = 4)Sex:M= Male,F= FemaleMEFL: Mid-eye to fork length (mm)Species: Common salmon names;DV= Dolly VardenVial,Tag_No,Tag_col: Genetic/tag metadata (not used in current template)
Date: Julian date of complete time series (observed and missing)- Species columns: Common names for salmon,
DV(Dolly Varden),Unk(unidentified) M_prefix columns: Indicates missing/partial daysNA: full count0: no fish counted>0: partial count
- Run the missing passage estimation script to prepare passage data and ensure ASL weighting is accurate.
- Run the ASL analysis script to generate composition summaries.
- Update the
.bibfile and R Markdown content. - Knit the
Data series template.rmdto produce the.docxreport. - Run the Python post-processing script to insert alt text, headers, and footers into the final Word file.
Using this template assumes familiarity with:
- Markdown and LaTeX (for formatting)
- R and R Markdown (for automation and reproducibility)
- Python (for DOI lookups and Word post-processing)
To reproduce the computing environment, run:
renv::restore()