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)

Arguments

h

histogram object or list from hist

density

logical to indicate the use of density or count

Value

list

Examples

library(dataui) h <- graphics::hist(stats::rnorm(100), plot = FALSE) dui_histogram( components = list( dui_barseries(binnedData = hist_to_binned_data(h)) ) )