Package 'BENMMI'

Title: Benthic Multi-Metric Index
Description: Analysis tool for evaluating benthic multimetric indices (BENMMIs). It generates reproducible reports on the analysis of benthic data, e.g., validation and correction of species names, sample pooling, automatic conversion of genus to species names, outlier detection, benthic indicator calculation, optimization of single and multimetric indicators against a pressure gradient, and spatial aggregation of benthic indicators. One of its use cases was the development of a common benthic indicator for <https://www.ospar.org> (publication accepted by Ecological Indicators). See Van Loon et al. (2018) <doi:10.1016/j.ecolind.2017.09.029> for details.
Authors: Dennis Walvoort [aut, cre], Willem van Loon [aut, cph]
Maintainer: Dennis Walvoort <[email protected]>
License: GPL (>= 3)
Version: 4.3-7
Built: 2024-11-27 06:55:35 UTC
Source: CRAN

Help Index


Perform BENMMI Analysis

Description

This function performs a complete BENMMI analysis following the settings provided in filename.

Usage

benmmi(filename = NULL, tmpdir = tempfile(pattern = "BENMMI"), browse = TRUE)

BENMMI(filename = NULL, tmpdir = tempdir(), browse = TRUE)

Arguments

filename

name of the JSON file defining all analysis steps.

tmpdir

directory to store temporary files (for debugging only)

browse

load resulting report in a browser? TRUE or FALSE

Examples

# This example illustrates a typical use case of the BENMMI-package.
# Note: execution may take several minutes.
# See the package vignette for more advanced examples and details. 

if (interactive()) {

# Create a work directory (in this example, a temporary
# directory, but in real use cases a persistent directory 
# will obviously be more useful).
my_dir <- tempfile("benmmi-example")
dir.create(my_dir)

# Populate this directory with simple use cases 
# (see the package-vignette for details).
# Most users will probably use one of these use cases as a 
# template for their own study.
BENMMIdir(my_dir)

# Run BENMMI given the settings in "settings-S-D-lin.json". This file
# relates to one of the predefined use cases. 
my_settings_file <- file.path(my_dir, "settings-S-D-lin.json")
benmmi(my_settings_file, browse = FALSE)

# The output (HTML-report and data-files) is stored in 'my_dir'
# and described in the package-vignette and resulting HTML-report itself.
# It is also possible to directly view the generated
# HTML-report by setting the browse-argument of the benmmi-function to TRUE.
}

Benthic Multi-Metric Indicator Analysis

Description

Reporting tool for a benthic multimetric indicator

Author(s)

Dennis Walvoort (Wageningen University & Research) & Willem van Loon (Rijkswaterstaat-The Netherlands)


Create BENMMI Directory Structure

Description

Creates a BENMMI-directory structure and populates it with some relevant BENMMI-files. Users may wish to modify this directory structure and add their own data.

Usage

BENMMIdir(path = NULL)

Arguments

path

name of an exisiting directory. This directory should be empty to prevent loss of data. If missing, a dialogue will appear.


Mean and Confidence Interval

Description

Mean and Confidence Interval

Usage

ci_mean(x, level = 0.9)

Arguments

x

numeric vector

level

confidence level

Note

Internal function. Not supposed to be called directly

Examples

stopifnot(all.equal(ci_mean(NA_real_), c(NA_real_, NA_real_, NA_real_)))
     stopifnot(all.equal(ci_mean(1), c(lower = NA_real_, mean = 1, upper = NA_real_)))
     stopifnot(all.equal(
         ci_mean(1:9, 0.95),
         c(lower = 2.934942, mean = 5.000000, upper = 7.065058), 
         tolerance = 0.0001)
     )

Read and Validate BENMMI Input Files

Description

This function reads and checks benthos files. The format is a superset of the BEQI2-format as specified in Van Loon (2013). In addition to the BEQI2-format, the benthos-format also includes columns latitude (LAT), longitude (LONG), and sieve mesh size (MESH).

Usage

read_mmi(filename)

Arguments

filename

name of benthos file (character)

References

Willem van Loon, 2013. BEQI2 INPUT FORMAT

See Also

read_beqi2


Read BENMMI Settings File

Description

This function reads BENMMI settings files. See the package vignette for a description of its format. Create an example file by calling the BENMMIdir-function.

Usage

read_settings(filename)

Arguments

filename

name of BENMMI input file (character)

Details

The function performs the following tasks:

  • checks the existence of filename;

  • reads JSON file while ignoring C-style comments;

  • checks avaiability of required keys in the JSON-file

  • checks values in JSON-file

See Also

BENMMIdir


Construct a Text Representation of a Weight Vector

Description

Construct a Text Representation of a Weight Vector

Usage

toString_weights(x)

Arguments

x

numeric or character vector

Note

Internal function. Not supposed to be called directly