consistency: Assess Consistency

View source: R/consistency.R

consistencyR Documentation

Assess Consistency

Description

Assess observed WHPT scores against consistency rules taking into account the expected class.

Usage

consistency(data)

Arguments

data

Dataframe

location_id

Location ID - unique identifer for location

sample_id

Sample ID - unique identifer for sample

question

Question - either ⁠WHPT ASPT Abund⁠ or ⁠WHPT NTAXA Abund⁠

response

Response value to question

NGR

National Grid Reference - Great Britain only

date_taken

Date as character class in 2012-12-31 format only

SX

Coordinated where GIS predictors come from

SY

Coordinated where GIS predictors come from

EX

Coordinated where GIS predictors queried

EY

Coordinated where GIS predictors queried

Altitude

Altitude in metres

d_f_source

Distance from source in metres

logaltbar

Log altitude in metres of catchment upstream

log_area

Log area of catchment upstream in km squared

disch_cat

Discharge category

slope

Slope in m / km

chalk

Proporation of chalk in catchment

clay

Proporation of clay in catchment

hardrock

Proporation of hardrock in catchment

limestone

Proporation of limestone in catchment

peat

Proporation of peat in catchment

shape_Length

Length of the river section represented in GIS layer

Reported WHPT Class Year

Reported WHPT Class Year

Typical ASPT Class

Typical expected ASPT Class for this location

Typical NTAXA Class

Typical expected NTAXA Class for this location

quality_element

The type of element being assessed in this case 'River Invertebrates'

index

The index being predicted in this case 'Reference ASPT' or 'Reference NTAXA'

predicted_response

The predicted response in this case the predicted NTAXA and ASPT

Value

Dataframe provides three outputs in three columns:

sample_id

Sample ID - unique identifer for sample

assessment

Name of the three assessments completed: assessment, driver and action. assessment identifies if the overall whpt result is ⁠Likely problem detected⁠, ⁠Possible cause for concern⁠, ⁠Better than expected⁠ or ⁠As expected⁠. The driver identifies whether NTAXA, ASPT or neither are driving the assessment. The action is the recommended action to take: ⁠No action required⁠, ⁠Non-urgent discussion...⁠, ⁠Urgent discussion..⁠

value

Associated value to the assessment column i.e. the output of the assessment

Examples

predictions <- whpt_predict(demo_data)
data <- dplyr::bind_rows(demo_data, predictions)
assessments <- consistency(data)

ecodata1/whpt documentation built on Sept. 27, 2024, 9:02 p.m.