# "histogram"/"hist" type convenience string(s)
tinyplot(Nile, type = "histogram")
# Use `type_histogram()` to pass extra arguments for customization
tinyplot(Nile, type = type_histogram(breaks = 30))
tinyplot(Nile, type = type_histogram(breaks = 30, freq = FALSE))
# etc.
# Grouped histogram example
tinyplot(
~Petal.Width | Species,
type = "histogram",
data = iris
)
# Faceted version
tinyplot(
~Petal.Width, facet = ~Species,
type = "histogram",
data = iris
)
# For visualizing faceted histograms across varying scales, you may also wish
# to impose free histogram breaks too (i.e., calculate breaks separately for
# each group). Compare:
# free facet scales + shared histogram breaks, versus...
tinyplot(
~Petal.Width, facet = ~Species,
facet.args = list(free = TRUE),
type = type_histogram(),
data = iris
)
# ... free facet scales + free histogram breaks
tinyplot(
~Petal.Width, facet = ~Species,
facet.args = list(free = TRUE),
type = type_histogram(free = TRUE),
data = iris
)
Run the code above in your browser using DataLab