| handleFlags,section-method {oce} | R Documentation |
Data-quality flags are stored in the metadata
slot of oce 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 contents of the data slot, based on
such data-quality flags. For example, a common operation is to replace
erroneous data with NA.
If metadata$flags in the first argument
is empty, then that object is returned, unaltered.
Otherwise, handleFlags analyses the data-quality flags within
the object, in context of the flags argument, and then interprets
the action argument to select an action that is to be applied
to the matched data.
## S4 method for signature 'section'
handleFlags(
object,
flags = NULL,
actions = NULL,
where = where,
debug = getOption("oceDebug")
)
object |
A section object. |
flags |
A list specifying flag values upon which actions will be taken. This can take two forms.
If |
actions |
an optional list that contains items with
names that match those in the |
where |
an optional character value that permits the function to work with
objects that store flags in e.g. |
debug |
An optional integer specifying the degree of debugging, with
value 0 meaning to skip debugging and 1 or higher meaning to print some
information about the arguments and the data. It is usually a good idea to set
this to 1 for initial work with a dataset, to see which flags are being
handled for each data item. If not supplied, this defaults to the value of
|
The default for flags is based on
calling defaultFlags() based on the
metadata in the first station in the section. If the
other stations have different flag schemes (which seems highly
unlikely for archived data), this will not work well, and indeed
the only way to proceed would be to use handleFlags,ctd-method()
on the stations, individually.
Other functions relating to data-quality flags:
defaultFlags(),
handleFlags,adp-method,
handleFlags,argo-method,
handleFlags,ctd-method,
handleFlags,oce-method,
handleFlags(),
initializeFlagScheme,ctd-method,
initializeFlagScheme,oce-method,
initializeFlagScheme,section-method,
initializeFlagSchemeInternal(),
initializeFlagScheme(),
initializeFlags,adp-method,
initializeFlags,oce-method,
initializeFlagsInternal(),
initializeFlags(),
setFlags,adp-method,
setFlags,ctd-method,
setFlags,oce-method,
setFlags()
Other things related to section data:
[[,section-method,
[[<-,section-method,
as.section(),
initializeFlagScheme,section-method,
plot,section-method,
read.section(),
section-class,
sectionAddStation(),
sectionGrid(),
sectionSmooth(),
sectionSort(),
section,
subset,section-method,
summary,section-method
library(oce) data(section) section2 <- handleFlags(section, flags=c(1,3:9)) par(mfrow=c(2, 1)) plotTS(section) plotTS(section2)