Data-quality flags are stored in the metadata
slot of oce-class
objects in a
list
named flags
.
The present function (a generic that has specialized versions
for various data classes) provides a way to
manipulate the core data based on
the data-quality flags. For example, a common operation is to replace suspicious
or erroneous data with NA
.If metadata$flags
in the object supplied as the first argument
is empty, then that object is returned, unaltered.
Otherwise, handleFlags
analyses the data-quality flags within
the object, in relation to the flags
argument, and interprets
the action
argument to select an action to be applied to mached
data.
Reasonable defaults are used if flags
and actions
are not supplied (see Details),
but different schemes are used in different
data archives, so it is risky to rely on these defaults.
It is usually necessary to tailor flags
and actions
to the data and the analysis goals.