Learn R Programming

confidence (version 1.1-2)

conf_input: Check Confidence data

Description

This function checks data.frames to be used by the confidence package. The format has been specified in Van Loon (2014) and should contain the following columns:

  • OBJECTID: water body code, e.g., NL89_os;

  • PAR: parameter, e.g., Cadmium;

  • DATE: date according to ISO 8601 (YYYY-mm-dd) for point values or year YYYY for annual means;

  • VALUE: numerical value.

  • TARGET: target value for the European Water Framework Directive;

  • UNIT: measurement unit of PAR. This unit should be the same for all records with the same PAR and is the same for both VALUE and TARGET;

  • transform: data transformation, i.e., log, logit, NA.

Usage

conf_input(x)

Arguments

x

data.frame to be checked

Value

data.frame that has passed all checks

Details

The function performs the following tasks:

  • checks availablitity of required columns (case insensitive);

  • make column names case-insensitive;

  • removes redundant spaces;

  • checks on missing values in required columns;

  • checks if DATE-field adheres to ISO 8601 (YYYY-mm-dd) or YYYY;

  • checks mixtures of annual averages and point values for a each year;

  • checks if measurement units are the same for a specific OBJECTID-PAR-pair;

  • checks if TARGET-value is the same for a specific OBJECTID-PAR-pair;

  • checks if transform is one of log, logit, NA in transform column;

  • checks that the EQR-column contains identical values fo each OBJECTID-PAR combination.