predict_indices: Calculating expected scores for macroinvertebrate indices...

View source: R/predict_indices.R

predict_indicesR Documentation

Calculating expected scores for macroinvertebrate indices using the RICT2 model

Description

The predict_indices function mirrors the functionality of the RICT model available on the MS Azure platform (https://gallery.azure.ai/Experiment/RICT-package-2). Specifically, it uses environmental (ENV) data from Ecology Data Explorer to generate expected scores under minimally impacted reference conditions for 80 indices, plus probabilities for RIVPACS end-groups. The prediction functionality applies the 'rict_predict()' function from the AquaMetrics RICT package (https://github.com/aquaMetrics/rict). No classification is undertaken.

Usage

predict_indices(env_data = x, save = FALSE, save_dir = getwd())

Arguments

env_data

A data frame or tibble containing site-level environmental data in Environment Agency Ecology Data Explorer format (as produced by the import_env function).

file_format

Format in which env_data is supplied: "EDE" - environmental data is formatted as downloaded from the EA's Ecology Data Explorer; "RICT" - environmental data is in the RICT template format.

save

Specifies whether or not expected indices data should be saved as a rds file (for future use); Default = TRUE.

save_dir

Path to folder where expected indices data is to be saved; Default = Current working directory.

all_indices

Boolean. TRUE - Return all indices in output (default); FALSE - only returns WHPT indices (arguement passed to rict::rict_predict).

Details

All data validation and transformation (conversion) are done in this function using functions predefined in HelperFunctionsv1.R. Predictions are made using PredictionfunctionsV2.R.

The function will modify the standard RICT output, renaming "SITE" as "biol_site_id" (standardised column header for biology sites).

Value

Tibble containing expected scores for macroinvertebrate indices plus end-group probabilities. The RICT Technical Specification and the RIVPACS IV End Group Descriptions are available at https://www.fba.org.uk/FBA/Public/Discover-and-Learn/Projects/User%20Guides.aspx

References

FBA, 2020. River Invertebrate Classification Tool (RICT2) User Guide V1.5 (2020) Available at: https://www.fba.org.uk/FBA/Public/Discover-and-Learn/Projects/User%20Guides.aspx

Examples

# Generate expected scores for macroinvertebrate indices, using environmental data downloaded from Ecology Data Explorer for site(s) of interest.
# Save dataset as .RDS file.
 predict_indices(env_data = env_data,
                  file_format = "EDE",
                  save = TRUE)

APEM-LTD/hetoolkit documentation built on Feb. 8, 2025, 9:16 a.m.