initializeFlagScheme,section-method {oce}R Documentation

Establish a data-quality scheme for a section object

Description

This function stores add an item named flagScheme to the metadata slot of an object inheriting from section-class. This is a list containing two items: name and mapping, as provided in the function arguments. The purpose is both to document a flag scheme and to make it so that initializeFlags, setFlags and handleFlags can specify flags by name, as opposed to number. This is a generic function, that may be specialized to the class of object (see “Details”).

Usage

## S4 method for signature 'section'
initializeFlagScheme(object, name = NULL,
  mapping = NULL, debug = getOption("oceDebug"))

Arguments

object

An oce object.

name

Character value naming the scheme. If this refers to a pre-defined scheme, then mapping must not be provided.

mapping

A list of named items describing the mapping from flag meaning to flag numerical value, e.g list(good=1, bad=2) might be used for a hypothetical class.

debug

Integer set to 0 for quiet action or to 1 for some debugging.

Details

The following pre-defined schemes are available (note that the names are simplified from the phrases used in defining documentation):

Value

An object with the metadata slot containing flagScheme.

Caution

This function was added in early May, 2018, and is likely to undergo changes until the autumn of that year. Use with caution.

References

1. The codes for "Argo" are defined at http://www.oceannetworks.ca/data-tools/data-quality

2. The codes for "BODC" are defined at http://seadatanet.maris2.nl/v_bodc_vocab_v2/browse.asp?order=conceptid&formname=search&screen=0&lib=l20

3. The codes for "DFO" are defined at http://www.dfo-mpo.gc.ca/science/data-donnees/code/list/014-eng.html

4. The codes for "WHP CTD" and "WHP bottle" are defined at https://www.nodc.noaa.gov/woce/woce_v3/wocedata_1/whp/exchange/exchange_format_desc.htm

See Also

Other functions relating to data-quality flags: defaultFlags, handleFlags,adp-method, handleFlags,argo-method, handleFlags,ctd-method, handleFlags,section-method, handleFlags, initializeFlagScheme,ctd-method, initializeFlagScheme,oce-method, initializeFlagScheme, initializeFlags,adp-method, initializeFlags,oce-method, initializeFlags, setFlags,adp-method, setFlags,ctd-method, setFlags,oce-method, setFlags

Other things related to section data: [[,section-method, [[<-,section-method, as.section, handleFlags,section-method, plot,section-method, read.section, section-class, sectionAddStation, sectionGrid, sectionSmooth, sectionSort, section, subset,section-method, summary,section-method

Examples

data(section)
sectionWithFlags <- initializeFlagScheme(section, "WHP bottle")
station1 <- sectionWithFlags[["station", 1]]
str(station1[["flagScheme"]])

[Package oce version 1.0-1 Index]