dhist | R Documentation |
Creates a discrete histogram object of class dhist
, with bin
locations
and masses
set to the 1D numeric vectors provided.
dhist(locations, masses, smoothing_window_width = 0, sorted = TRUE)
locations |
A 1D numeric vector specifying the discrete locations of the histogram bins |
masses |
A 1D numeric vector specifying the mass present at each location |
smoothing_window_width |
If greater than 0, the discrete histogram will
be treated as having the mass at each location "smoothed" uniformly across
a bin centred on the location and having width = |
sorted |
Whether or not to return a discrete histogram with locations
and masses sorted by ascending mass (default = |
A sparse discrete histogram. Format is a dhist
object, which
is a list of class dhist
with the following named elements:
locations
: A 1D numeric vector of discrete locations
masses
: A 1D numeric vector of the mass present at each location
Note that locations where no mass is present are not included in the returned
dhist
object. Mass in these discrete histograms is treated as being
present precisely at the specified location. Discrete histograms should not be used
for data where observations have been grouped into bins representing ranges
of observation values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.