¹ In theory, the histograms should align perfectly. In practice, ash::bin1() differs from graphics::hist(), e.g. compare ash::bin1(faithful$eruptions, ab = c(1.6, 5.2), nbin = 18)$nc and hist(faithful$eruptions, breaks = 18, right = TRUE, plot = FALSE)$counts.
The following code should produce (nearly¹) overlapping histograms:
...but it doesn't:
The reason is that
ash::ash1()
is never provided withm
(orkopt
), but is rather always called with the defaultm = 5
:https://github.com/hrbrmstr/ggalt/blob/30dc0dade4d0b8d78eddea7409a07f86dbbafa76/R/geom_ash.r#L115-L127
¹ In theory, the histograms should align perfectly. In practice,
ash::bin1()
differs fromgraphics::hist()
, e.g. compareash::bin1(faithful$eruptions, ab = c(1.6, 5.2), nbin = 18)$nc
andhist(faithful$eruptions, breaks = 18, right = TRUE, plot = FALSE)$counts
.