Learn R Programming

FFA Framework Wiki

The FFA Framework is an open-source tool for flood frequency analysis (FFA) designed to support systematic and repeatable workflows for stationary and nonstationary analysis. Development is ongoing at the University of Calgary and the University of Saskatchewan in Canada.

The most recent version of the framework is freely available as an R package. The original version was released as a standalone GUI with MATLAB source code and published in Vidrio-Sahagún et al. (2024). For a list of changes from the MATLAB version, see here.

Installation Instructions

From CRAN (Recommended)

  1. Ensure that R (v4.4.0 or later) is installed on your machine.

  2. Open an R session by executing the R command in a terminal.

  3. Run install.packages("ffaframework") from the R session.

  4. Exit the R session with q(). The 'ffaframework' package is now installed and ready to use.

Development Version

Warning: The development version is updated frequently and may contain issues.

  1. Ensure that Git and R (v4.4.0 or later) are installed on your machine.

  2. Open a terminal and navigate to the directory where you want to install the package.

  3. Clone the Github repository by executing the following command:

     git clone https://github.com/rileywheadon/ffa-framework.git
  4. Open an R session. Then install and load the devtools package (if not already installed):

     install.packages("devtools")
     library(devtools)
  5. Install the 'ffaframework' package:

     devtools::install("~/path/to/ffa-package")

    Replace ~/path/to/ffa-package with the path to the cloned directory from step 2.

  6. Exit the R session with q(). The 'ffaframework' package is now installed and ready to use.

Troubleshooting FAQ

How do I know if R is installed?

You can check your R version by executing the R --version command in a terminal.

I just installed R on Windows but the R command doesn't work.

Windows users may need to add R to their PATH environment variable. The default location for R is C:\Program Files\R\R-4.5.0\bin (replace "4.5.0" with the version of R you have installed). To update the PATH, edit the system environment variables from the settings menu.

Copy Link

Version

Install

install.packages('ffaframework')

Version

0.1.1

License

AGPL (>= 3)

Maintainer

Riley Wheadon

Last Published

August 29th, 2025

Functions in ffaframework (0.1.1)

eda_pettitt_test

Pettitt Test for Abrupt Changes in the Mean of a Time Series
eda_white_test

White Test for Heteroskedasticity
eda_sens_trend

Sen's Trend Estimator
eda_runs_test

Wald–Wolfowitz Runs Test for Randomness
eda_spearman_test

Spearman Test for Autocorrelation
eda_bbmk_test

Block-Bootstrap Mann-Kendall Test for Trend Detection
eda_mk_test

Mann–Kendall Trend Test
eda_pp_test

Phillips–Perron Unit Root Test
eda_kpss_test

Kwiatkowski–Phillips–Schmidt–Shin (KPSS) Unit Root Test
eda_mks_test

Mann–Kendall–Sneyers Test for Change Point Detection
framework_ffa

Orchestrate Flood Frequency Analysis
fit_mle

Maximum Likelihood Parameter Estimation
model_assessment

Model Assessment
mu_sigma

Compute Location and Scale of Kappa Distribution
framework_full

Orchestrate the Full FFA Framework
ffaframework-package

Flood Frequency Analysis Framework
fit_lmoments

L-Moments Parameter Estimation
fit_lmoments_kappa

L-Moments Parameter Estimation for the Kappa Distribution
fit_gmle

Generalized Maximum Likelihood Parameter Estimation
param-generate-report

Parameter 'generate_report'
param-ns-structure

Parameter 'ns_structure'
param-distribution

Parameter 'distribution'
param-method

Parameter 'method'
framework_eda

Orchestrate Exploratory Data Analysis
param-periods

Parameter 'periods'
param-ns-slices

Parameter 'ns_slices'
param-report-path

Parameter 'report_path'
param-ns-splits

Parameter 'ns_splits'
param-report-formats

Parameter 'report_formats'
param-params

Parameter 'params'
plot_mks_test

Plot Mann–Kendall–Sneyers (MKS) Test Results
plot_nsffa_estimates

Plot Estimated Return Levels for NS-FFA
param-ns-slice

Parameter 'ns_slice'
plot_ams_data

Plot Annual Maximum Series Data
plot_bbmk_test

Plot Block‐Bootstrap Mann–Kendall Test Results
param-ns-years

Parameter 'ns_years'
param-p

Parameter 'p'
plot_pettitt_test

Plot Results from the Pettitt Change‐Point Test
plot_runs_test

Plot Runs Test Results
param-tolerance

Parameter 'tolerance'
param-ns-structures

Parameter 'ns_structures'
param-years

Parameter 'years'
param-samples

Parameter 'samples'
plot_sffa_fit

Plot Fitted Probability Distribution for S-FFA
plot_nsffa_fit

Plot Fitted Probability Distributions for NS-FFA
plot_lmom_diagram

Plot L-Moment Ratio Diagram
uncertainty_bootstrap

Parametric Bootstrap Uncertainty Quantification
plot_nsffa_assessment

Plot Model Assessment for NS-FFA
select_ldistance

L-Distance Method for Distribution Selection
select_zstatistic

Z-Statistic Method for Distribution Selection
uncertainty_rfgpl

Regula-Falsi Generalized Profile Likelihood Uncertainty Quantification
param-alpha

Parameter 'alpha'
plot_spearman_test

Plot Spearman’s Rho Autocorrelation
utils_sample_lmoments

Sample L-moments
utils_quantiles

Quantile Functions for Probability Models
sumquad_tau3tau4

Compute L-moment Distance for Kappa Distribution
param-data

Parameter 'data'
plot_sffa_assessment

Plot Model Assessment for S-FFA
plot_sffa_estimates

Plot Estimated Return Levels for S-FFA
param-prior

Parameter 'prior'
param-q

Parameter 'q'
utils_generalized_likelihood

Generalized Log-Likelihood Functions for GEV Models
utils_theoretical_lmoments

Theoretical L-moments of Probability Distributions
select_lkurtosis

L-Kurtosis Method for Distribution Selection
utils_log_likelihood

Log-Likelihood Functions for Probability Models
uncertainty_rfpl

Regula-Falsi Profile Likelihood Uncertainty Quantification
utils_cdf

Cumulative Distribution Functions for Probability Models
data_decomposition

Decompose Annual Maximum Series
CAN_08NH021

CAN-08NH021
data_local

Fetch Local Package Data
data_geomet

Fetch Data from MSC GeoMet API
data_screening

Perform Data Screening
data_mw_variability

Estimate Variance for Annual Maximum Series Data
CAN_08MH016

CAN-08MH016
CAN_05BB001

CAN-05BB001
CAN_08NM050

CAN-08NM050
CAN_07BE001

CAN-07BE001