Subset an argo object, either by selecting just the "adjusted" data or by subsetting by pressure or other variables.
# S4 method for argo subset(x, subset, ...)
an argo object.
An expression indicating how to subset
optional arguments, of which only the first is examined. The
only possibility is
within, a polygon enclosing data to be
retained. This must be either a list or data frame, containing items
latitude; see Example 4. If
within is given,
subset is ignored.
An argo object.
subset is the string
replaces the station variables with their adjusted counterparts. In
the argo notation, e.g.
PSAL is replaced with
in the present notation, this means that
salinity in the
slot is replaced with
salinityAdjusted, and the latter is deleted.
Similar replacements are also done with the flags stored in the
subset is an expression, then the action is somewhat similar
subset functions, but with the restriction that
only one independent variable may be
used in in any call to the function, so that
repeated calls will be necessary to subset based on more than one
independent variable. Subsetting may be done by anything
stored in the data, e.g.
pressure or by
profile (a made-up variable),
id (from the
metadata slot) or
ID (a synonym for
Note that subsetting by
preserves matrix shape, by setting discarded values to
NA, as opposed
to dropping data (as is the case with
time, for example).
# Example 2: restrict attention to delayed-mode profiles. par(mfrow=c(1, 1)) plot(subset(argo, dataMode == "D")) # Example 3: contrast adjusted and unadjusted data par(mfrow=c(1, 2)) plotTS(argo) plotTS(subset(argo, "adjusted")) # Example 2. Subset by a polygon determined with locator() par(mfrow=c(1, 2)) plot(argo, which="map") # Can get a boundary with e.g. locator(4) boundary <- list(x=c(-65, -40, -40, -65), y=c(65, 65, 45, 45)) argoSubset <- subset(argo, within=boundary) plot(argoSubset, which="map")
Other things related to argo data:
Other functions that subset oce objects: