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

Monthly Downloads

135

Version

0.1.2

License

AGPL (>= 3)

Maintainer

Riley Wheadon

Last Published

October 27th, 2025

Functions in ffaframework (0.1.2)

eda_pettitt_test

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

CAN-08NH021
eda_mks_test

Mann–Kendall–Sneyers Test for Change Point Detection
eda_mk_test

Mann–Kendall Trend Test
framework_ffa

Orchestrate Flood Frequency Analysis
eda_pp_test

Phillips–Perron Unit Root Test
framework_full

Orchestrate the Full FFA Framework
param-tolerance

Parameter 'tolerance'
param-method

Parameter 'method'
param-samples

Parameter 'samples'
param-ns-slice

Parameter 'ns_slice'
fit_mle

Maximum Likelihood Parameter Estimation
framework_eda

Orchestrate Exploratory Data Analysis
fit_lmoments

L-Moments Parameter Estimation
fit_lmoments_kappa

L-Moments Parameter Estimation for the Kappa Distribution
eda_sens_trend

Sen's Trend Estimator
param-distribution

Parameter 'distribution'
ffaframework-package

Flood Frequency Analysis Framework
param-ns-slices

Parameter 'ns_slices'
fit_gmle

Generalized Maximum Likelihood Parameter Estimation
plot_nsffa_assessment

Plot Model Assessment for NS-FFA
plot_mks_test

Plot Mann–Kendall–Sneyers (MKS) Test Results
param-ns-splits

Parameter 'ns_splits'
plot_bbmk_test

Plot Block‐Bootstrap Mann–Kendall Test Results
plot_lmom_diagram

Plot L-Moment Ratio Diagram
param-generate-report

Parameter 'generate_report'
param-report-path

Parameter 'report_path'
param-report-formats

Parameter 'report_formats'
param-years

Parameter 'years'
mu_sigma

Compute Location and Scale of Kappa Distribution
param-ns-structures

Parameter 'ns_structures'
plot_nsffa_estimates

Plot Estimated Return Levels for NS-FFA
param-periods

Parameter 'periods'
param-params

Parameter 'params'
param-ns-structure

Parameter 'ns_structure'
uncertainty_rfgpl

Regula-Falsi Generalized Profile Likelihood Uncertainty Quantification
uncertainty_bootstrap

Parametric Bootstrap Uncertainty Quantification
plot_nsffa_fit

Plot Fitted Probability Distributions for NS-FFA
param-data

Parameter 'data'
param-alpha

Parameter 'alpha'
plot_pettitt_test

Plot Results from the Pettitt Change‐Point Test
param-ns-years

Parameter 'ns_years'
select_lkurtosis

L-Kurtosis Method for Distribution Selection
select_ldistance

L-Distance Method for Distribution Selection
uncertainty_rfpl

Regula-Falsi Profile Likelihood Uncertainty Quantification
param-p

Parameter 'p'
param-prior

Parameter 'prior'
param-q

Parameter 'q'
plot_runs_test

Plot Runs Test Results
plot_sffa_assessment

Plot Model Assessment for S-FFA
plot_ams_data

Plot Annual Maximum Series Data
plot_sffa_fit

Plot Fitted Probability Distribution for S-FFA
plot_spearman_test

Plot Spearman’s Rho Autocorrelation
utils_theoretical_lmoments

Theoretical L-moments of Probability Distributions
utils_cdf

Cumulative Distribution Functions for Probability Models
select_zstatistic

Z-Statistic Method for Distribution Selection
utils_quantiles

Quantile Functions for Probability Models
sumquad_tau3tau4

Compute L-moment Distance for Kappa Distribution
utils_sample_lmoments

Sample L-moments
plot_sffa_estimates

Plot Estimated Return Levels for S-FFA
utils_log_likelihood

Log-Likelihood Functions for Probability Models
utils_generalized_likelihood

Generalized Log-Likelihood Functions for GEV Models
data_local

Fetch Local Package Data
data_decomposition

Decompose Annual Maximum Series
data_geomet

Fetch Data from MSC GeoMet API
data_mw_variability

Estimate Variance for Annual Maximum Series Data
CAN_08MH016

CAN-08MH016
data_screening

Perform Data Screening
eda_kpss_test

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

Wald–Wolfowitz Runs Test for Randomness
eda_spearman_test

Spearman Test for Autocorrelation
eda_white_test

White Test for Heteroskedasticity
eda_bbmk_test

Block-Bootstrap Mann-Kendall Test for Trend Detection
CAN_07BE001

CAN-07BE001
CAN_05BB001

CAN-05BB001
CAN_08NM050

CAN-08NM050
model_assessment

Model Assessment