summarise_wqdata: Summarise Water Quality Data

View source: R/summarise-wqdata.R

summarise_wqdataR Documentation

Summarise Water Quality Data

Description

Calculates summary statistics for water quality data using log-normal maximum-likelihood models.

Usage

summarise_wqdata(
  x,
  by = NULL,
  censored = FALSE,
  na.rm = FALSE,
  conf_level = 0.95,
  quan_range = 0.5
)

Arguments

x

The data.frame to summarise.

by

A character vector specifying the columns in x to independently summarise by.

censored

A flag specifying whether to account for non-detects.

na.rm

A flag specifying whether to exclude missing Value values when summarising.

conf_level

A number between 0 and 1 specifying confidence limits. By default calculates 95% confidence intervals.

quan_range

A number between 0 and 1 specifying the quantile range. By default calculates the inter-quartile range.

Details

The data set must include a numeric 'Value' and a character or factor 'Variable' column.

By default the summary statistics are independently calculated for each Variable. The user can specify additional columns to independently calculate the statistics by using the by argument.

If the user wishes to account for non-detects using left-censored maximum-likelihood (by setting censored = TRUE) the data set must also include a numeric DetectionLimit column.

Missing values in the DetectionLimit column are assumed to indicate that the Values are not censored. Missing values in the Value column are always considered to be missing values. If the user wishes to exclude missing values in the Value column they should set na.rm = TRUE.

Value

A tibble of the summary statistics.

Examples

data.frame(Variable = "var", Value = 1:5, stringsAsFactors = FALSE)

bcgov/wqbc documentation built on Feb. 11, 2023, 11:15 p.m.