The function FUN is applied to f in bins specified by
xbreaks and ybreaks.
Arguments
- x
a vector of numerical values.
- y
a vector of numerical values.
- f
a vector of data to which
FUNwill be applied.- xbreaks
values of
xat the boundaries between the bins; calculated usingpretty()if not supplied.- ybreaks
as
xbreaks, but fory.- FUN
function that is applied to the
fvalues in each (x,y) bin. This must take two numeric vectors as input, and return a single numeric value.- include.lowest
logical value indicating whether to include
xvalues that equalxbreaks[1]andyvalues that equalybreaks[1]. See “Details”.- ...
optional arguments to pass to
FUN.
Value
A list with the following elements:
xbreaks and ybreaks as used, mid-points
xmids and ymids, and result, a matrix containing the
result of applying FUN() to the f values
in the designated bins.
Details
The division into bins is done with cut(), to which include.lowest
is passed. By default, the x bins are open at the left and closed
on the right, and the y bins are open at the bottom and closed
at the top. However, if include.lowest is TRUE, then those
boundary points are included in the calculation.
See also
Other bin-related functions:
binApply1D(),
binAverage(),
binCount1D(),
binCount2D(),
binMean1D(),
binMean2D()