Skip to content

Repository for an R Markdown (Rmd) Template for Automating U.S. Fish and Wildlife Service Weir Data Series Reports

Notifications You must be signed in to change notification settings

JBoersmaUSFWS/Weir-Data-series-Automator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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


Suggested Citation

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.


Author ORCID


Overview

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.


Repository Contents

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.

Data Format Notes

ASL Data (Data/ folder):

  • Date: Julian date of sampling
  • Age: European-style format (e.g., 2.1 means total age = 2 + 1 + 1 = 4)
  • Sex: M = Male, F = Female
  • MEFL: Mid-eye to fork length (mm)
  • Species: Common salmon names; DV = Dolly Varden
  • Vial, Tag_No, Tag_col: Genetic/tag metadata (not used in current template)

Passage Data:

  • 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 days
    • NA: full count
    • 0: no fish counted
    • >0: partial count

Standard Operating Procedure

  1. Run the missing passage estimation script to prepare passage data and ensure ASL weighting is accurate.
  2. Run the ASL analysis script to generate composition summaries.
  3. Update the .bib file and R Markdown content.
  4. Knit the Data series template.rmd to produce the .docx report.
  5. Run the Python post-processing script to insert alt text, headers, and footers into the final Word file.

Background Knowledge

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()

About

Repository for an R Markdown (Rmd) Template for Automating U.S. Fish and Wildlife Service Weir Data Series Reports

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published