This is a convenience function to convert a histogram object from hist
into the binned value format expected by 'data-ui' dui_barseries
and dui_densityseries
argument binnedData
.
hist_to_binned_data(h = NULL, density = TRUE)
h | histogram object or list from |
---|---|
density |
|
list
library(dataui) h <- graphics::hist(stats::rnorm(100), plot = FALSE) dui_histogram( components = list( dui_barseries(binnedData = hist_to_binned_data(h)) ) )