binData | R Documentation |
Construct bins that start from floor(min(x))
or min(x)
and either double
in size or are of equal width, and encompass the data. More generalised
version of log2bins()
.
binData(
x = NULL,
counts = NULL,
binWidth = NULL,
binBreaks = NULL,
startInteger = TRUE
)
x |
vector of individual values (e.g. body masses). Only |
counts |
dataframe (or array) with first column being an x value
(e.g. body mass), and second column being the counts of the
number of individuals for that value. Only |
binWidth |
type of bins to use:
|
binBreaks |
pre-defined bin breaks as a vector. Only |
startInteger |
TRUE or FALSE, whether to start the bin breaks at an integer
power of 2 (for method |
list containing:
indiv: dataframe with a row for each x
value, with columns:
x
: original x
values
binMid
, binMin
, binMax
, binWidth
: midpoint, minimum,
maximum, and width, respectively, of the bin within
which the x
value falls. If indiv has >=10^6
rows then it isn't saved.
If counts
was specified then an equivalent x
vector is created and is column x
(i.e. x
values are repeated). May
not be the most efficient way, but is easiest to program.
binVals: dataframe with a row for each new bin and columns:
binMid
, binMin
, binMax
, binWidth
: midpoint, minimum,
maximum, and width, respectively, of the bin
binCount
: total number of individuals in that bin
binCountNorm
: normalised bin count, binCount / binWidth
binSum
: sum of individual values in that bin (appropriate if x
represents biomass, but not length)
binSumNorm
: binSum / binWidth
log10....
- log10()
of some of the above quantities
Andrew Edwards
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.