| Title: | Confidence Estimation of Environmental State Classifications |
|---|---|
| Description: | Functions for estimating and reporting multi-year averages and corresponding confidence intervals and distributions. A potential use case is reporting the chemical and ecological status of surface waters according to the European Water Framework Directive. |
| Authors: | Willem van Loon [aut, cph], Dennis Walvoort [aut, cre] |
| Maintainer: | Dennis Walvoort <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 1.1-3 |
| Built: | 2026-05-31 10:36:11 UTC |
| Source: | https://github.com/cran/confidence |
Back-transformations
Performs inverse log or logit transformations.
backtransform(x, type = c("identity", "log", "logit", "none", NA_character_))backtransform(x, type = c("identity", "log", "logit", "none", NA_character_))
x |
value to back-transform |
type |
type of transform (log, logit). |
backtransformed value
This function starts the 'confidence tool'. The results will be stored in a subdirectory in the current working directory. See details section below.
conf(x = NULL, tmpdir = tempfile(pattern = "confidence"), browse = TRUE)conf(x = NULL, tmpdir = tempfile(pattern = "confidence"), browse = TRUE)
x |
name of the input file or a |
tmpdir |
directory to store temporary files (for debugging only) |
browse |
load resulting report directly in a browser? |
This function will create a subdirectory
in the same directory as x, in case x is a filename or
in the current working directory (see getwd), in case
x is a data.frame.
The computer should have write permission to this directory, if not an error message will be raised. The subdirectory contains an HTML-report with all analysis results. For convenience, the results are also stored in CSV-format (tables) and png-format (figures) for further processing.
confidence and the package vignette
(vignette("confidence")).
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.
conf_input(x)conf_input(x)
x |
|
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.
data.frame that has passed all checks
Annual arithmetic average concentration of 1,2-dichloroethane (DCA) in
a specific water body (), based on Baggelaar et al., (2010)
The columns represent the following information:
water body code
parameter, in this case 1,2-dichloroethane
colors in density function
year
annual arithmetic average concentration
target according to the European Water Framework Directive
measurement unit ()
Baggelaar, P., O. van Tongeren, R. Knoben, & W. van Loon, 2010. Rapporteren van de betrouwbaarheid van KRW-beoordelingen. H2O 16, p.21–25
Annual artithmetic average environmental quality ratio's (EQR) for Macrofauna in a specific water body, based on Baggelaar et al., (2010)
The columns represent the following information:
water body code
parameter, in this case EQR
colors in density function
year
annual arithmetic average EQR
target EQR
applied transform
Baggelaar, P., O. van Tongeren, R. Knoben, & W. van Loon, 2010. Rapporteren van de betrouwbaarheid van KRW-beoordelingen. H2O 16, p.21–25
A data set with two time-series of simulated metal contents. These data have mainly been used to test the package. Users may find this dataset convenient as an example to construct their own data sets. The columns represent the following information:
water body code, e.g., NL89_os
parameter, e.g., Cadmium
colors in density function
date according to ISO 8601 (YYYY-mm-dd) for point values or year YYYY for annual means
numerical value
e.g., the target value for the European Water Framework Directive
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
data transformation, i.e., log, logit, NA
Estimates the multi-year average of environmental properties and associated confidence intervals.
mya(x, ...)mya(x, ...)
x |
object of class |
... |
further arguments to be passed to other methods |
a data.frame with the following columns:
MYA: the multi-year arithmetic average;
PROB_LTT: the probability that MYA is less than the target value specified;
PROB_GTT: the probability that MYA is greater than the target value specified;
q05: the lowerbound of the 90% confidence interval of MYA;
q95: the upperbound of the 90% confidence interval of MYA.
Sanitize Text to Give Proper Filenames
sanitize(x)sanitize(x)
x |
character vector to sanitize |
sanitized character vector
This function removes redundant spaces from character vectors
strip_spaces(x)strip_spaces(x)
x |
character vector |
character vector without trailing or multiple spaces
stopifnot(confidence:::strip_spaces(" Hello World ") == "Hello World")stopifnot(confidence:::strip_spaces(" Hello World ") == "Hello World")
Transformations
Performs log or logit transformations.
transform(x, type = c("identity", "log", "logit", "none", NA_character_))transform(x, type = c("identity", "log", "logit", "none", NA_character_))
x |
value to transform |
type |
type of transform (log, logit). |
transformed value
Internal Functions For Writing HTML
write_html(x, ...)write_html(x, ...)
x |
object |
... |
further arguments passed to or from other methods. |