14 Fish Passage Reporting (fpr)

14.1 What is fpr?

fpr is a package used to clean data, QA, and build interactive reports usually related to fish passage planning, implementation and monitoring. We use fpr to access our PostgreSQL database, QA photos, build tables, and more! Check out the package here.

14.2 A quick guide to get you set up

  1. Install with pak::pkg_install("NewGraphEnvironment/fpr")
  2. Load the package with library(fpr)
  3. Run the following code to get started, fpr_db_query(fpr_dbq_lstables()). This will return a list of tables in the Postgres database (see screenshot for what it should look like). You must have your environmental variables set up to connect to the database, see Environmental variables.

14.3 Fpr functions

  • We have developed many functions to help with the reporting process, access databases, and clean data. Here are some of the main functions:

    • fpr_db_query(): This function is used to query the database. It takes a SQL query as an argument and returns a data frame.
    • fpr_dbq_lstables(): This function returns a list of tables in the database.
    • fpr_dbq_lscols(): This function returns a list of all columns in a postgres table.
    • Handle and QA photos
    • Build tables
    • Reporting
    • And more!
  • See Packages for instruction on how to get information about a function or package.