Geoscience Reference
In-Depth Information
classes with no counts. In practice, the square root of the total number of
observations
length(corg)
, rounded to the nearest integer using
round
, is
ot en used as the number of bins. In our example
nbin
can be calculated
using
nbin = round(sqrt(length(corg)))
which yields
nbin =
8
h e eight bin centers
v
are calculated by typing
vmin = min(corg) + 0.5*range(corg)/nbin;
vmax = max(corg) - 0.5*range(corg)/nbin;
vwth = range(corg)/nbin;
v = vmin : vwth : vmax;
which yields
v =
Columns 1 through 4
9.7383 10.3814 11.0245 11.6676
Columns 5 through 8
12.3107 12.9537 13.5968 14.2399
h e smallest bin center
vmin
equals the minimum value in the data
corg
plus
half of the range of the data
corg
, divided by the number of bins
nbin
. Similarly,
the largest bin center
vmin
equals the maximum value of the data
corg
minus
half of the range of the data
corg
, divided by
nbin
. h e bin width
ewth
is
calculated by dividing the range of the data
corg
by
nbin
. h e corresponding
nine bin edges
e
are calculated using
emin = min(corg);
emax = max(corg);
ewth = range(corg)/nbin;
e = emin : ewth : emax;
which yields
e =
Columns 1 through 4
9.4168 10.0598 10.7029 11.3460
Columns 5 through 8
11.9891 12.6322 13.2753 13.9184
Column 9
14.5615
h e smallest and largest bin edges,
emin
and
emax
, correspond to the mininum