Skip to content

ggdist 3.2.1

Choose a tag to compare

@mjskay mjskay released this 18 Jan 17:24
· 339 commits to master since this release

New features and enhancements:

  • Support for non-numeric distributions in stat_slabinterval() and
    stat_dotsinterval(), including dist_categorical(), dist_bernoulli(),
    and the upcoming posterior::rvar_factor() type. (#108)
  • Various improvements to dotplot layout in geom_dotsinterval():
    • new layout = "hex" allows a hexagonal circle-packing style layout (#161).
    • new mechanism for smoothing dotplots using the smooth parameter, including
      smooth = "bounded" / smooth = "unbounded" (for "density dotplots") and
      smooth = "discrete" / smooth = "bar" (for improved layout of large-n
      discrete distributions). (#161)
    • a better bin/dot-nudging algorithm using constrained optimization (#163)
    • new overlaps = "keep" option disables bin/dot nudging in "bin", "hex",
      and "weave" layouts. This means layout = "weave" with overlaps = "keep"
      will yield exact dot positions. (#161)
    • The "weave" layout now works properly with side = "both"
    • fixed binning artifacts when there is high density on the edges, particularly
      right edges (#144)
    • use a max binwidth of 1 for discrete distributions (#159)
    • new overflow = "compress" allows layouts to be compressed to fit into the
      geom bounds if a user-specified binwidth would otherwise cause the dots
      to exceed the geom bounds. (#162)
  • Two new shortcut geoms for geom_dotsinterval(): geom_swarm() and geom_weave().
    Both can be used to quickly create "beeswarm"-like plots.
  • A new "mirrored" scale for the side aesthetic, scale_side_mirrored(), makes it
    easier to create mirrored slabs and dotplots. (#142)
  • Custom density estimators can now be used with stat_slabinterval() via the
    density argument, including a new bounded density estimator (density_bounded()).
    (#113)
  • Following the split between size and linewidth aesthetics in ggplot2 3.4,
    the following aesthetics have been updated (#138):
    • interval_size is now linewidth
    • slab_size is now slab_linewidth
    • in geom_slab(), geom_dots(), and geom_lineribbon(), size is now linewidth
  • A new experimental mini domain-specific language for probability expressions
    in ggdist stats: the Pr_() and p_() functions can be used to generate
    after_stat() expressions in terms of ggdist computed variables; e.g.
    aes(thickness = !!Pr_(X <= x)) maps the CDF of the distribution onto the
    thickness aesthetic; aes(thickness = !!p_(x)) maps the PDF onto the
    thickness aesthetic. (#160)
  • Several function families in ggdist now use "currying" (automatic partial
    function application). These function families partially apply themselves until all
    non-optional arguments have been supplied: point_interval(), smooth_...,
    and density_.... See help("automatic-partial-functions").
  • Performance improvements for point_interval() on grouped data frames. (#154)

Documentation:

  • Uses of stat() have been replaced with after_stat() to be consistent with
    the deprecation of stat() in ggplot2 3.4.