Average the values of a vector f in bins defined on another
vector x. A common example might be averaging CTD profile
data into pressure bins (see “Examples”).
Usage
binMean1D(x, f, xbreaks)
Arguments
x
vector of numerical values.
f
vector of numerical values.
xbreaks
Vector of values of x at the boundaries between bins, calculated using
pretty() if not supplied.
Value
A list with the following elements: the breaks (xbreaks,
midpoints (xmids) between those breaks,
the count (number) of x values between successive breaks,
and the resultant average (result) of f, classified by the
x breaks.