🛠️ Development Notes and Standards

This file documents reusable patterns and conventions used across all analytic and Shiny projects.


✅ Function Documentation Standard

All shared or reusable functions should follow this structure:

MyFunction <- function(...) {
  # DOCUMENTATION -------------------------------------------------------------------------------
  # MyFunction() — <Brief purpose statement>
  # Location: <relative project path>
  #
  # FLOW:
  #   <ASCII-style flow diagram using → or ⟲ as needed>
  #
  # EXPECTS:
  #   <Parameter description, especially for structured inputs>
  #
  # USAGE:
  #   <Minimal calling example>
  #
  # RETURNS:
  #   <Class and description of return value>
  #
  # NOTES:
  #   <Any assumptions, edge cases, or internal references>
  #
  # CODE ----------------------------------------------------------------------------------------
  ...
}

💡 Tips

  • ✅ Avoid internal # ====, # ----, or other divider lines that may interfere with RStudio folding.
  • ✅ Use NULL rather than NA in pipeline controller tibbles for maximum clarity and compatibility.
  • ✅ Only use (loop indicator) in FLOW sections when actual loops are involved.
  • ✅ Keep all documentation inside the function, so it travels with the code during refactors.
  • ✅ Prefer named object references in pipeline_tib, not quoted names.

You may freely extend this document to include naming patterns, folder structure, or import behavior as your tooling matures.