log2bins | R Documentation |
Construct bins that double in size and encompass the data, resulting in
binBreaks
..., 0.25, 0.5, 1, 2, 4, 8, 16,.... as necessary, where the
breaks are powers of 2. Adapting from LBNbiom.method()
. See binData()
for a generalised version.
log2bins(x = NULL, counts = NULL)
x |
vector of individual values (e.g. body masses) |
counts |
dataframe (or array) with first column being an |
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 it easiest to
program. May not need indiv
returned, but it needs to be calculated
anyway.
binVals
: dataframe with a row for each new bin, with columns:
binMid
, binMin
, binMax
, binWidth
: midpoint, minimum, maximum, and width,
respectively, of the bin
binCount
: total number of individuals in that bin
binCountNorm
: 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.