[{"path":"http://mjskay.github.io/ggdist/articles/dotsinterval.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Dots + interval stats and geoms","text":"vignette describes dots+interval geoms stats ggdist. flexible sub-family stats geoms designed make plotting dotplots straightforward. particular, supports selection useful layouts (including classic Wilkinson layout, weave layout, beeswarm layout) can automatically select dot size dotplot stays within bounds plot.","code":""},{"path":"http://mjskay.github.io/ggdist/articles/dotsinterval.html","id":"setup","dir":"Articles","previous_headings":"","what":"Setup","title":"Dots + interval stats and geoms","text":"following libraries required run vignette:","code":"library(dplyr) library(tidyr) library(distributional) library(ggdist) library(ggplot2) library(patchwork)  theme_set(theme_ggdist())"},{"path":"http://mjskay.github.io/ggdist/articles/dotsinterval.html","id":"anatomy-of-geom_dotsinterval","dir":"Articles","previous_headings":"","what":"Anatomy of geom_dotsinterval()","title":"Dots + interval stats and geoms","text":"dotsinterval family geoms stats sub-family slabinterval (see vignette(\"slabinterval\")), “slab” collection dots forming dotplot interval summary point (e.g., mean, median, mode) arbitrary number intervals. base geom_dotsinterval() uses variety custom aesthetics create composite geometry:  Depending whether want horizontal vertical orientation, can provide ymin ymax instead xmin xmax. default, aesthetics (e.g., fill, color, size, alpha) set properties multiple sub-geometries . example, color aesthetic default sets color point interval, can also overridden point_color interval_color set color sub-geometry separately. Due relationship geom_slabinterval() family, aesthetics specific “dots” sub-geometry referred prefix slab_. using standalone geom_dots() geometry, necessary use custom aesthetics:  geom_dotsinterval() often useful paired stat_dotsinterval(), automatically calculate points intervals map onto endpoints interval sub-geometry. stat_dotsinterval() stat_dots() can used two types data, depending aesthetic mappings provide: Sample data; e.g. draws data distribution, bootstrap distribution, Bayesian posterior distribution (distribution, really). use stats sample data, map sample values onto x y aesthetic. Distribution objects analytical distributions. use stats type data, must use xdist, ydist aesthetics, take distributional objects, posterior::rvar() objects, distribution names (e.g. \"norm\", refers Normal distribution provided dnorm/pnorm/qnorm functions). used analytical distributions (e.g. distributional::dist_normal()), quantiles argument determines number quantiles used (therefore number dots shown); default 100. dotsinterval geoms can plotted horizontally vertically. Depending aesthetics mapped, attempt automatically determine orientation; produce correct result, orientation can overridden setting orientation = \"horizontal\" orientation = \"vertical\".","code":""},{"path":"http://mjskay.github.io/ggdist/articles/dotsinterval.html","id":"controlling-dot-layout","dir":"Articles","previous_headings":"","what":"Controlling dot layout","title":"Dots + interval stats and geoms","text":"Size layout dots dotplot controlled four parameters: scale, binwidth, dotsize, stackratio.  scale: binwidth set (NA), binwidth determined automatically height highest stack dots less scale. default value scale, 0.9, ensures small gap dotplots multiple dotplots drawn. binwidth: width bins used lay dots: NA (default): Use scale determine bin width. single numeric unit(): exact bin width use. numeric, bin width expressed data units; use unit() specify width terms screen coordinates (e.g. unit(0.1, \"npc\") make bin width 0.1 normalized parent coordinates, 10% plot width.) 2-vector numerics unit()s giving acceptable minimum maximum width. automatic bin width algorithm attempt find largest bin width two values also keeps tallest stack dots shorter scale. dotsize: size dots percentage binwidth. default value 1.07 rather 1. value chosen largely trial error, find value gives nice-looking layouts circular dots continuous distributions, accounting fact slight overlap dots tends give nicer apparent visual distance adjacent stacks precise value 1. stackratio: distance centers dots stack proportion height dot. stackratio = 1, default, mean dots just touch; stackratio < 1 means dots overlap , stackratio > 1 means dots gaps .","code":""},{"path":"http://mjskay.github.io/ggdist/articles/dotsinterval.html","id":"side","dir":"Articles","previous_headings":"","what":"Side","title":"Dots + interval stats and geoms","text":"side aesthetic allows adjust positioning direction dots: \"top\", \"right\", \"topright\": draw dots top right, depending orientation \"bottom\", \"left\", \"bottomleft\": draw dots bottom left, depending orientation \"topleft\": draw dots top left, depending orientation \"bottomright\": draw dots bottom right, depending orientation \"\": draw dots mirrored, “beeswarm” plot. orientation = \"horizontal\", yields:  orientation = \"vertical\", yields:","code":"set.seed(1234) x = rnorm(100)  side_plot = function(...) {   expand.grid(     x = x,     side = c(\"topright\", \"both\", \"bottomleft\"),     stringsAsFactors = FALSE   ) %>%     ggplot(aes(side = side, ...)) +     geom_dots() +     facet_grid(~ side, labeller = \"label_both\") +     labs(x = NULL, y = NULL) +     theme(panel.border = element_rect(color = \"gray75\", fill = NA)) } side_plot(x = x) +   labs(title = \"Horizontal geom_dots() with different values of side\") +   scale_y_continuous(breaks = NULL) side_plot(y = x) +   labs(title = \"Vertical geom_dots() with different values of side\") +   scale_x_continuous(breaks = NULL)"},{"path":"http://mjskay.github.io/ggdist/articles/dotsinterval.html","id":"layout","dir":"Articles","previous_headings":"","what":"Layout","title":"Dots + interval stats and geoms","text":"layout parameter allows adjust algorithm used place dots: \"bin\" (default): places dots -axis midpoint bins classic Wilkinson dotplot. maintains alignment rows columns dotplot. layout slightly different classic Wilkinson algorithm : (1) nudges bins slightly avoid overlapping bins (2) input data symmetrical return symmetrical layout. \"weave\": uses basic binning approach “bin”, places dots -axis actual positions (modulo overlaps, nudged way). maintains alignment rows align dots within columns. \"hex\": uses basic binning approach “bin”, alternates placing dots +binwidth/4 -binwidth/4 -axis bin center. allows hexagonal packing setting stackratio less 1 (something like 0.9 tends work). “swarm”: uses \"compactswarm\" layout beeswarm::beeswarm(). maintain alignment rows columns, can compact neat looking, especially sample data (opposed quantile dotplots theoretical distributions, may look better \"bin\", \"weave\", \"hex\"). side \"top\", layouts look like :  side \"\", layouts look like :","code":"layout_plot = function(layout, side, ...) {   data.frame(     x = x   ) %>%     ggplot(aes(x = x)) +     geom_dots(layout = layout, side = side, stackratio = if (layout == \"hex\") 0.9 else 1) +     labs(       subtitle = paste0(\"layout = \", deparse(layout), if (layout == \"hex\") \" with stackratio = 0.9\"),       x = NULL,       y = NULL     ) +     scale_y_continuous(breaks = NULL) +     theme(panel.border = element_rect(color = \"gray75\", fill = NA)) }  (layout_plot(\"bin\", side = \"top\") + layout_plot(\"hex\", side = \"top\")) /   (layout_plot(\"weave\", side = \"top\") + layout_plot(\"swarm\", side = \"top\")) +   plot_annotation(title = 'geom_dots() layouts with side = \"top\"') (layout_plot(\"bin\", side = \"both\") + layout_plot(\"hex\", side = \"both\")) /   (layout_plot(\"weave\", side = \"both\") + layout_plot(\"swarm\", side = \"both\")) +   plot_annotation(title = 'geom_dots() layouts with side = \"both\"')"},{"path":"http://mjskay.github.io/ggdist/articles/dotsinterval.html","id":"beeswarm-plots","dir":"Articles","previous_headings":"Layout","what":"Beeswarm plots","title":"Dots + interval stats and geoms","text":"Thus, possible create beeswarm plots using geom_dots() side = \"\":  side = \"\" also tends work well \"hex\" \"swarm\" layouts classic-looking “beeswarm” plots:  combination binwidth = unit(1.5, \"mm\") overflow = \"compress\" (see section large samples, ) can used set dot size specific size guaranteeing layout stays within bounds geom. combination used two shortcut geoms, geom_swarm() geom_weave(), use \"swarm\" \"weave\" layouts respectively. also use side = \"\", intended make easy create good-looking beeswarm plots without manually tweaking settings:","code":"set.seed(1234)  abc_df = tibble(   value = rnorm(300, mean = c(1,2,3), sd = c(1,2,2)),   abc = rep(c(\"a\", \"b\", \"c\"), 100) )  abc_df %>%   ggplot(aes(x = abc, y = value)) +   geom_dots(side = \"both\") +   ggtitle('geom_dots(side = \"both\")') abc_df %>%   ggplot(aes(x = abc, y = value)) +   geom_dots(side = \"both\", layout = \"hex\", stackratio = 0.92) +   ggtitle('geom_dots(side = \"both\", layout = \"hex\")') set.seed(1234)  swarm_data = tibble(   y = rnorm(300, c(1,4)),   g = rep(c(\"a\",\"b\"), 150) )  swarm_plot = swarm_data %>%   ggplot(aes(x = g, y = y)) +   geom_swarm(linewidth = 0, alpha = 0.75) +   labs(title = \"geom_swarm()\")  weave_plot = swarm_data %>%   ggplot(aes(x = g, y = y)) +   geom_weave(linewidth = 0, alpha = 0.75) +   labs(title = \"geom_weave()\")  swarm_plot + weave_plot"},{"path":"http://mjskay.github.io/ggdist/articles/dotsinterval.html","id":"varying-color-fill-shape-and-linewidth","dir":"Articles","previous_headings":"","what":"Varying color, fill, shape, and linewidth","title":"Dots + interval stats and geoms","text":"Aesthetics like color, fill, shape, linewidth can varied dots. example, can vary fill aesthetic create two subgroups, use position = \"dodge\" dodge entire “swarms” subgroups overlap. ’ll also set linewidth = 0 default gray outline drawn:","code":"set.seed(12345)  abcc_df = tibble(   value = rnorm(300, mean = c(1,2,3,4), sd = c(1,2,2,1)),   abc = rep(c(\"a\", \"b\", \"c\", \"c\"), 75),   hi = rep(c(\"h\", \"h\", \"h\", \"i\"), 75) )  abcc_df %>%   ggplot(aes(y = value, x = abc, fill = hi)) +   geom_weave(position = \"dodge\", linewidth = 0, alpha = 0.75) +   scale_fill_brewer(palette = \"Dark2\") +   ggtitle(     'geom_weave(position = \"dodge\")',     'aes(fill = hi, shape = hi)'   )"},{"path":"http://mjskay.github.io/ggdist/articles/dotsinterval.html","id":"varying-discrete-aesthetics-within-dot-groups","dir":"Articles","previous_headings":"Varying color, fill, shape, and linewidth","what":"Varying discrete aesthetics within dot groups","title":"Dots + interval stats and geoms","text":"default, assign discrete variable fill, color,shape, etc also used thegroup` aesthetic determine dot groups, laid separate (can dodged separately, ). override behavior setting group NA (variable want group dot layouts ), geom_dotsinterval() leave dots data order within layout allow aesthetics vary across . example:  default, dot positions within bins \"bin\" layout determined data values (e.g. y values chart). can override passing variable order aesthetic, set sort order within bins. can used create “stacked” dotplots setting order discrete variable:","code":"abcc_df %>%   ggplot(aes(y = value, x = abc, fill = hi, group = NA)) +   geom_dots(linewidth = 0) +   scale_color_brewer(palette = \"Dark2\") +   ggtitle(     'geom_dots()',     'aes(fill = hi, group = NA)'   ) abcc_df %>%   ggplot(aes(y = value, x = abc, fill = hi, group = NA, order = hi)) +   geom_dots(linewidth = 0) +   scale_color_brewer(palette = \"Dark2\") +   ggtitle(     'geom_dots()',     'aes(fill = hi, group = NA, order = hi)'   )"},{"path":"http://mjskay.github.io/ggdist/articles/dotsinterval.html","id":"varying-continuous-aesthetics-within-dot-groups","dir":"Articles","previous_headings":"Varying color, fill, shape, and linewidth","what":"Varying continuous aesthetics within dot groups","title":"Dots + interval stats and geoms","text":"Continuous variables can also varied within groups. Since continuous variables automatically set group aesthetic, can simply assign desired aesthetic want vary:","code":"abcc_df %>%   arrange(hi) %>%   ggplot(aes(y = value, x = abc, shape = abc, color = value)) +   geom_dots() +   ggtitle(     'geom_dots()',     'aes(color = value)'   )"},{"path":"http://mjskay.github.io/ggdist/articles/dotsinterval.html","id":"constraining-dot-size","dir":"Articles","previous_headings":"","what":"Constraining dot size","title":"Dots + interval stats and geoms","text":"sample sizes can vary widely (dynamically), can difficult set reasonable dot size works charts. case, can useful set constraints dot sizes picked automatic bin width selection algorithm. example, large samples, dots may become smaller desired. Consider following increasingly large samples:  dots become quite small 5000-dot dotplot, making harder read. can set constraints desired dot size / bin width using binwidth argument. set specific bin width, pass single value; set constraints, pass length-2 vector, first element min second max. min can 0 max can Inf want constrain value (max min, respectively). bin width can data units (using numeric values) plotting units (using grid::unit()s). example, constrain dot size greater 1mm:  Notice dots now go page receive warning suggestions fix layout. set overflow = \"compress\", instead overflowing, layout compress spacing dots keep within geometry’s bounds:  settings give reasonable displays small sample sizes scale larger sample sizes without changing settings.","code":"set.seed(1234)  ns = c(50, 200, 500, 5000) increasing_samples = data.frame(   x = rgamma(sum(ns), 2, 2),   n = rep(ns, ns) )  increasing_samples %>%   ggplot(aes(x = x)) +   geom_dots() +   facet_wrap(~ n) +   labs(     title = \"geom_dots()\",     subtitle = \"on large samples, dots may get too small\"   ) increasing_samples %>%   ggplot(aes(x = x)) +   geom_dots(binwidth = unit(c(1, Inf), \"mm\")) +   facet_wrap(~ n) +   labs(     title = \"geom_dots()\",     subtitle = 'binwidth = unit(c(1.5, Inf), \"mm\")'   ) ## Warning: The provided binwidth will cause dots to overflow the boundaries of the geometry. ## → Set `binwidth = NA` to automatically determine a binwidth that ensures dots fit within the ##   bounds, ## → OR set `overflow = \"compress\"` to automatically reduce the spacing between dots to ensure the ##   dots fit within the bounds, ## → OR set `overflow = \"keep\"` to allow dots to overflow the bounds of the geometry without producing ##   a warning. ## ℹ For more information, see the documentation of the `binwidth` and `overflow` arguments of ##   `?ggdist::geom_dots()` or the section on constraining dot sizes in vignette(\"dotsinterval\") ##   (`vignette(ggdist::dotsinterval)`). ## The provided binwidth will cause dots to overflow the boundaries of the geometry. ## → Set `binwidth = NA` to automatically determine a binwidth that ensures dots fit within the ##   bounds, ## → OR set `overflow = \"compress\"` to automatically reduce the spacing between dots to ensure the ##   dots fit within the bounds, ## → OR set `overflow = \"keep\"` to allow dots to overflow the bounds of the geometry without producing ##   a warning. ## ℹ For more information, see the documentation of the `binwidth` and `overflow` arguments of ##   `?ggdist::geom_dots()` or the section on constraining dot sizes in vignette(\"dotsinterval\") ##   (`vignette(ggdist::dotsinterval)`). increasing_samples %>%   ggplot(aes(x = x)) +   geom_dots(binwidth = unit(c(1, Inf), \"mm\"), overflow = \"compress\", alpha = 0.75) +   facet_wrap(~ n) +   labs(     title = \"geom_dots()\",     subtitle = 'binwidth = unit(c(1, Inf), \"mm\"), overflow = \"compress\"'   )"},{"path":"http://mjskay.github.io/ggdist/articles/dotsinterval.html","id":"on-discrete-distributions","dir":"Articles","previous_headings":"","what":"On discrete distributions","title":"Dots + interval stats and geoms","text":"dots family includes variety features make visualizing discrete categorical distributions easier. distributions can hard visualize default settings dots become small:  automatic bin width algorithm selects dot size small order ensure tallest bin fits plot, means dots hard see. Bar-like layouts can achieved using layout = \"bar\":  Notice set group = NA override default ggplot2 behavior grouping data discrete variables. allows layout calculated taking groups account. can also use smooth parameter improve display discrete distributions, geom_dots() supports handful smoothers. correspond functions start smooth_, like smooth_bounded(), smooth_unbounded(), smooth_discrete(), can applied either passing suffix string (e.g. smooth = \"bounded\") passing function , set specific options (e.g. smooth = smooth_bounded(adjust = 0.5)). smooth_discrete() applies kernel density smoother whose default bandwidth less distances bins. can use kernel argument (passed density_bounded(); kernels stats::density() available) change shape bins. example, using \"epanechnikov\" (parabolic) kernel along side = \"\", can create lozenge-like shapes. ’ll abbreviate kernel \"ep\" save typing \"epanechnikov\" (partial matching allowed):","code":"set.seed(1234) abcd_df = tibble(   x = sample(c(\"a\", \"b\", \"c\", \"d\"), 1000, replace = TRUE, prob = c(0.27, 0.6, 0.03, 0.005)),   g = rep(c(\"a\",\"b\"), 500) )  abcd_df %>%   ggplot(aes(x = x)) +   geom_dots() +   scale_y_continuous(breaks = NULL) +   labs(     title = \"geom_dots()\",     subtitle = \"on a large discrete sample\"   ) abcd_df %>%   ggplot(aes(x = x, fill = g, order = g)) +   geom_dots(layout = \"bar\", group = NA, color = NA) +   scale_y_continuous(breaks = NULL) +   labs(     title = 'geom_dots(aes(fill = g), layout = \"bar\", group = NA)',     subtitle = \"on a large discrete sample\"   ) abcd_df %>%   ggplot(aes(x = x)) +   geom_dots(smooth = smooth_discrete(kernel = \"ep\"), side = \"both\") +   scale_y_continuous(breaks = NULL) +   labs(     title = 'geom_dots(smooth = smooth_discrete(kernel = \"ep\"), side = \"both\")',     subtitle = \"on a large discrete sample\"   )"},{"path":"http://mjskay.github.io/ggdist/articles/dotsinterval.html","id":"on-analytical-distributions","dir":"Articles","previous_headings":"","what":"On analytical distributions","title":"Dots + interval stats and geoms","text":"Like stat_slabinterval() family, stat_dotsinterval() stat_dots() support using sample data (via x y aesthetics) analytical distributions (via xdist ydist aesthetics). analytical distributions, stats accept specifications distributions one two ways: Using distribution names character vectors: format uses aesthetics follows: xdist, ydist, dist: name distribution, following R’s naming scheme. string \"p\", \"q\", \"d\" functions defined : e.g., “norm” valid distribution name pnorm(), qnorm(), dnorm() functions define CDF, quantile function, density function Normal distribution. args arg1, … arg9: arguments distribution. use args, list column element list containing arguments distribution functions; alternatively, can pass arguments directly using arg1, … arg9. Using distribution vectors distributional package posterior::rvar() objects: format uses aesthetics follows: xdist, ydist, dist: distribution vector posterior::rvar() produced functions distributional::dist_normal(), distributional::dist_beta(), posterior::rvar_rng(), etc. example, variety distributions:  example also shows use sub-guides label dot counts. See documentation subguide_axis() shortcuts (particularly subguide_integer() subguide_count()) examples. Analytical distributions shown default using 100 quantiles, sometimes referred quantile dotplot, can help people make better decisions uncertainty (Kay 2016, Fernandes 2018). can changed using quantiles argument. example, can plot distributions using 1000 quantiles. ’ll also make use point_interval plot mode highest-density continuous intervals (instead default median quantile intervals; see point_interval()). ’ll also highlight intervals coloring dots. Like stat_slabinterval() family, computed variables interval sub-geometry (level .width) available dots/slab sub-geometry, correspond smallest interval containing dot. can use color dots according interval containing (’ll also use \"weave\" layout since maintains x positions better \"bin\" layout):  summarizing sample distributions stat_dots()/stat_dotsinterval() (e.g. samples Bayesian posteriors), one can also use quantiles argument, though default.","code":"dist_df = tibble(   dist = c(dist_normal(1,0.25), dist_beta(3,3), dist_gamma(5,5)),   dist_name = format(dist) )  dist_df %>%   ggplot(aes(y = dist_name, xdist = dist)) +   stat_dotsinterval(subguide = 'integer') +   ggtitle(     \"stat_dotsinterval(subguide = 'integer')\",     \"aes(y = dist_name, xdist = dist)\"   ) dist_df %>%   ggplot(aes(y = dist_name, xdist = dist, slab_fill = after_stat(level))) +   stat_dotsinterval(quantiles = 1000, point_interval = mode_hdci, layout = \"weave\", slab_color = NA) +   scale_color_manual(values = scales::brewer_pal()(3)[-1], aesthetics = \"slab_fill\") +   ggtitle(     \"stat_dotsinterval(quantiles = 1000, point_interval = mode_hdci)\",     \"aes(y = dist_name, xdist = dist, slab_fill = after_stat(level))\"   )"},{"path":"http://mjskay.github.io/ggdist/articles/dotsinterval.html","id":"varying-continuous-aesthetics-with-analytical-distributions","dir":"Articles","previous_headings":"On analytical distributions","what":"Varying continuous aesthetics with analytical distributions","title":"Dots + interval stats and geoms","text":"varying discrete aesthetics works similarly stat_dotsinterval()/stat_dots() geom_dotsinterval()/geom_dots(), varying continuous aesthetics within dot groups typically requires mapping continuous aesthetic stats computed. stat (least analytical distributions) must first generate quantiles properties quantiles can mapped aesthetics. Thus, relies upon generated variables stat, can use after_stat() stage() functions ggplot2 map variables. example:  example also demonstrates use sub-geometry scales: slab_-prefixed aesthetics slab_color slab_shape must used target color shape slab (“slab” refers stack dots) using geom_dotsinterval() stat_dotsinterval() disambiguate point/interval dot stack. using stat_dots()/geom_dots() necessary. Also note use scale_color_distiller(), base ggplot2 color scale, slab_color aesthetic setting aesthetics guide properties (latter necessary default guide = \"colorbar\" work non-standard color aesthetics).","code":"dist_df %>%   ggplot(aes(y = dist_name, xdist = dist, slab_color = after_stat(x))) +   stat_dotsinterval(slab_shape = 19, quantiles = 500) +   scale_color_distiller(aesthetics = \"slab_color\", guide = \"colorbar2\") +   ggtitle(     \"stat_dotsinterval(slab_shape = 19, quantiles = 500)\",     'aes(slab_color = after_stat(x)) +\\nscale_color_distiller(aesthetics = \"slab_color\", guide = \"colorbar2\")'   )"},{"path":"http://mjskay.github.io/ggdist/articles/dotsinterval.html","id":"thresholds","dir":"Articles","previous_headings":"On analytical distributions","what":"Thresholds","title":"Dots + interval stats and geoms","text":"Another potentially useful application post-stat aesthetic computation apply thresholds dotplot, coloring points one side line differently. However, default dotplot layout, \"bin\", can cause dots wrong side cutoff coloring dots within dotplots. Thus can useful plotting thresholds use \"weave\" \"swarm\" layouts, tend position dots closer true x positions, rather bin centers:","code":"ab_df = tibble(   ab = c(\"a\", \"b\"),   mean = c(5, 7),   sd = c(1, 1.5) )  ab_df %>%   ggplot(aes(y = ab, xdist = dist_normal(mean, sd), fill = after_stat(x < 6))) +   stat_dots(position = \"dodge\", color = NA, layout = \"weave\") +   labs(     title = 'stat_dots(layout = \"weave\")',     subtitle = \"aes(fill = after_stat(x < 6))\"   ) +   geom_vline(xintercept = 6, alpha = 0.25) +   scale_x_continuous(breaks = 2:10)"},{"path":"http://mjskay.github.io/ggdist/articles/dotsinterval.html","id":"rain-cloud-plots","dir":"Articles","previous_headings":"","what":"Rain cloud plots","title":"Dots + interval stats and geoms","text":"Sometimes may want include multiple different types slabs plot order take advantage features slab type provides. example, people often combine densities dotplots show underlying datapoints go density estimate, creating -called rain cloud plots. use multiple slab geometries together, can use side parameter change side interval slab drawn set scale parameter something around 0.5 (default 0.9) two slabs overlap. ’ll also scale halfeye slab thickness n (number observations group) area slab represents sample size (looks similar total area corresponding dotplot). ’ll use subsample data show might look reasonably-sized dataset.","code":"set.seed(12345) # for reproducibility  tibble(   abc = rep(c(\"a\", \"b\", \"b\", \"c\"), 50),   value = rnorm(200, c(1, 8, 8, 3), c(1, 1.5, 1.5, 1)) ) %>%   ggplot(aes(y = abc, x = value, fill = abc)) +   stat_slab(aes(thickness = after_stat(pdf*n)), scale = 0.7) +   stat_dotsinterval(side = \"bottom\", scale = 0.7, slab_linewidth = NA) +   scale_fill_brewer(palette = \"Set2\") +   ggtitle(     paste0(       'stat_slab(aes(thickness = after_stat(pdf*n)), scale = 0.7) +\\n',       'stat_dotsinterval(side = \"bottom\", scale = 0.7, slab_linewidth = NA)'     ),     'aes(fill = abc)'   )"},{"path":"http://mjskay.github.io/ggdist/articles/dotsinterval.html","id":"dotplots-with-monte-carlo-standard-error","dir":"Articles","previous_headings":"","what":"Dotplots with Monte Carlo Standard Error","title":"Dots + interval stats and geoms","text":"specialized variant geom_dots(), geom_blur_dots(), supports visualizing dotplots blur applied dot. stat_mcse_dots() uses geom_blur_dots() posterior::mcse_quantile() show error quantile quantile dotplot:  Custom blur functions can selected using blur parameter, including built-blur_interval(), draws interval default width 95%:","code":"increasing_samples %>%   ggplot(aes(x = x)) +   stat_mcse_dots(quantiles = 100) +   facet_wrap(~ n) +   labs(     title = \"stat_mcse_dots(quantiles = 100)\",     subtitle = \"Monte Carlo Standard Error of each quantile shown as blur\"   ) increasing_samples %>%   ggplot(aes(x = x)) +   stat_mcse_dots(quantiles = 100, blur = \"interval\") +   facet_wrap(~ n) +   labs(     title = 'stat_mcse_dots(quantiles = 100, blur = \"interval\")',     subtitle = \"Monte Carlo Standard Error of each quantile shown as 95% intervals\"   )"},{"path":"http://mjskay.github.io/ggdist/articles/dotsinterval.html","id":"logit-dotplots","dir":"Articles","previous_headings":"","what":"Logit dotplots","title":"Dots + interval stats and geoms","text":"demonstrate another useful plot type, logit dotplot (courtesy Ladislas Nalborczyk), ’ll fit logistic regression data petal length Iris versicolor Iris virginica flowers. First, ’ll demo varying side aesthetic create two dotplots “facing” : scale_side_mirrored() set side aesthetic \"top\" \"bottom\" two categories assigned side“. also adjust scale dots don’t overlap:  can also accomplished setting side directly omitting scale_side_mirrored(); e.g. via aes(side = ifelse(Species == \"virginica\", \"bottom\", \"top\")). Now fit logistic regression predicting species based petal length: can overlay fit line stat_lineribbon() (see vignette(\"lineribbon\")) top mirrored dotplots create logit dotplot:","code":"iris_v = iris %>%   filter(Species != \"setosa\")  iris_v %>%   ggplot(aes(x = Petal.Length, y = Species, side = Species)) +   geom_dots(scale = 0.5) +   scale_side_mirrored(guide = \"none\") +   ggtitle(     \"geom_dots(scale = 0.5)\",     'aes(side = Species) + scale_side_mirrored()'   ) m = glm(Species == \"virginica\" ~ Petal.Length, data = iris_v, family = binomial) m ##  ## Call:  glm(formula = Species == \"virginica\" ~ Petal.Length, family = binomial,  ##     data = iris_v) ##  ## Coefficients: ##  (Intercept)  Petal.Length   ##      -43.781         9.002   ##  ## Degrees of Freedom: 99 Total (i.e. Null);  98 Residual ## Null Deviance:       138.6  ## Residual Deviance: 33.43     AIC: 37.43 # construct a prediction grid for the fit line prediction_grid = with(iris_v,   data.frame(Petal.Length = seq(min(Petal.Length), max(Petal.Length), length.out = 100)) )  prediction_grid %>%   bind_cols(predict(m, ., se.fit = TRUE)) %>%   mutate(     # distribution describing uncertainty in log odds     log_odds = dist_normal(fit, se.fit),     # inverse-logit transform the log odds to get     # distribution describing uncertainty in Pr(Species == \"virginica\")     p_virginica = dist_transformed(log_odds, plogis, qlogis)   ) %>%   ggplot(aes(x = Petal.Length)) +   geom_dots(     aes(y = as.numeric(Species == \"virginica\"), side = Species),     scale = 0.4,     data = iris_v   ) +   stat_lineribbon(     aes(ydist = p_virginica), alpha = 1/4, fill = \"#08306b\"   ) +   scale_side_mirrored(guide = \"none\") +   coord_cartesian(ylim = c(0, 1)) +   labs(     title = \"logit dotplot: geom_dots() with stat_lineribbon()\",     subtitle = 'aes(side = Species) + scale_side_mirrored()',     x = \"Petal Length\",     y = \"Pr(Species = virginica)\"   )"},{"path":"http://mjskay.github.io/ggdist/articles/freq-uncertainty-vis.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Frequentist uncertainty visualization","text":"vignette shows combine ggdist geoms output broom package enable visualization uncertainty frequentist models. general idea use xdist ydist aesthetics supported ggdist stats visualize confidence distributions instead visualizing posterior distributions might Bayesian model. information families geoms stats ggdist, see vignette(\"slabinterval\"), vignette(\"dotsinterval\"), vignette(\"lineribbon\"). Confidence distributions way unifying notion sampling distributions, bootstrap distributions, several concepts frequentist inference. convenient tool visualizing uncertainty way generalizes across Bayesian frequentist frameworks: Bayesian framework might visualize probability distribution, frequentist framework visualize confidence distribution. gives us way use geometries uncertainty visualization either framework. confidence distributions, see: Xie, Min‐ge, Kesar Singh. Confidence distribution, frequentist distribution estimator parameter: review. International Statistical Review 81.1 (2013): 3-39.","code":""},{"path":"http://mjskay.github.io/ggdist/articles/freq-uncertainty-vis.html","id":"setup","dir":"Articles","previous_headings":"","what":"Setup","title":"Frequentist uncertainty visualization","text":"following libraries required run vignette:","code":"library(dplyr) library(tidyr) library(ggdist) library(ggplot2) library(broom) library(distributional)  theme_set(theme_ggdist())"},{"path":"http://mjskay.github.io/ggdist/articles/freq-uncertainty-vis.html","id":"point-estimates","dir":"Articles","previous_headings":"","what":"Point estimates","title":"Frequentist uncertainty visualization","text":"’ll start ordinary least squares (OLS) linear regression analysis simple dataset: typical tidy format data frame: one observation per row. Graphically:  simple linear regression data fit follows: default summary great uncertainty communication perspective: let’s try half-eye plots instead. basic idea need get three parameters sampling distribution parameter use stat_halfeye() plot . confidence distribution parameter \\(\\), \\(\\tilde\\beta_i\\), lm model scaled--shifted t distribution: \\[ \\tilde\\beta_i \\sim \\textrm{student_t}\\left(\\nu, \\hat\\beta_i, \\sigma_{\\hat\\beta_i}\\right) \\] : \\(\\nu\\): degrees freedom, equal df.residual(m_ABC) \\(\\hat\\beta_i\\): location, equal point estimate parameter (estimate column broom::tidy()) \\(\\sigma_{\\hat\\beta_i}\\): scale, equal standard error parameter estimate (std.error column broom::tidy()) can get estimates standard errors easily using broom::tidy(): Finally, can construct vectors probability distributions using functions like distributional::dist_student_t() distributional package. stat_slabinterval() family functions supports objects. Putting everything together, :  rather see uncertainty conditional means, can instead use tidyr::expand() along broom::augment() (similar can use tidyr::expand() tidybayes::add_fitted_draws() Bayesian models). want confidence distribution mean condition \\(c\\), \\(\\tilde\\mu_c\\): \\[ \\tilde\\mu_c \\sim \\textrm{student_t}\\left(\\nu, \\hat\\mu_c, \\sigma_{\\hat\\mu_c} \\right) \\] : \\(\\nu\\): degrees freedom, equal df.residual(m_ABC) \\(\\hat\\mu_c\\): location, equal point estimate mean condition \\(c\\) (.fitted column broom::augment()) \\(\\sigma_{\\hat\\mu_c}\\): scale, equal standard error mean condition \\(c\\) (.se.fit column broom::augment(..., se_fit = TRUE)) Putting everything together, :  course, works entire stat_slabinterval() family. gradient plots instead:  Note: example uses experimental fill_type = \"gradient\" option. can omitted system support ; see discussion section gradient plots vignette(\"slabinterval\"). complementary cumulative distribution function (CCDF) bar plots:  can also create quantile dotplots using dots family geoms. Quantile dotplots show quantiles distribution (case, sampling distribution), employing frequency framing approach uncertainty communication can easier people interpret (Kay et al. 2016, Fernandes et al. 2018):  See vignette(\"slabinterval\") vignette(\"dotsinterval\") examples uncertainty geoms stats slabinterval family.","code":"set.seed(5) n = 10 n_condition = 5 ABC =   tibble(     condition = rep(c(\"A\",\"B\",\"C\",\"D\",\"E\"), n),     response = rnorm(n * 5, c(0,1,2,1,-1), 0.5)   ) ABC %>%   ggplot(aes(x = response, y = condition)) +   geom_point(alpha = 0.5) +   ylab(\"condition\") m_ABC = lm(response ~ condition, data = ABC) summary(m_ABC) ##  ## Call: ## lm(formula = response ~ condition, data = ABC) ##  ## Residuals: ##     Min      1Q  Median      3Q     Max  ## -0.9666 -0.4084 -0.1053  0.4104  1.2331  ##  ## Coefficients: ##             Estimate Std. Error t value Pr(>|t|)     ## (Intercept)   0.1816     0.1732   1.048  0.30015     ## conditionB    0.8326     0.2450   3.399  0.00143 **  ## conditionC    1.6930     0.2450   6.910 1.38e-08 *** ## conditionD    0.8456     0.2450   3.452  0.00122 **  ## conditionE   -1.1168     0.2450  -4.559 3.94e-05 *** ## --- ## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ##  ## Residual standard error: 0.5478 on 45 degrees of freedom ## Multiple R-squared:  0.7694, Adjusted R-squared:  0.7489  ## F-statistic: 37.53 on 4 and 45 DF,  p-value: 8.472e-14 tidy(m_ABC) ## # A tibble: 5 × 5 ##   term        estimate std.error statistic      p.value ##   <chr>          <dbl>     <dbl>     <dbl>        <dbl> ## 1 (Intercept)    0.182     0.173      1.05 0.300        ## 2 conditionB     0.833     0.245      3.40 0.00143      ## 3 conditionC     1.69      0.245      6.91 0.0000000138 ## 4 conditionD     0.846     0.245      3.45 0.00122      ## 5 conditionE    -1.12      0.245     -4.56 0.0000394 m_ABC %>%   tidy() %>%   ggplot(aes(y = term)) +   stat_halfeye(     aes(xdist = dist_student_t(df = df.residual(m_ABC), mu = estimate, sigma = std.error))   ) ABC %>%   expand(condition) %>%   augment(m_ABC, newdata = ., se_fit = TRUE) %>%   ggplot(aes(y = condition)) +   stat_halfeye(     aes(xdist = dist_student_t(df = df.residual(m_ABC), mu = .fitted, sigma = .se.fit)),     scale = .5   ) +   # we'll add the data back in too (scale = .5 above adjusts the halfeye height so   # that the data fit in as well)   geom_point(aes(x = response), data = ABC, pch = \"|\", size = 2, position = position_nudge(y = -.15)) ABC %>%   expand(condition) %>%   augment(m_ABC, newdata = ., se_fit = TRUE) %>%   ggplot(aes(y = condition)) +   stat_gradientinterval(     aes(xdist = dist_student_t(df = df.residual(m_ABC), mu = .fitted, sigma = .se.fit)),     scale = .5, fill_type = \"gradient\"   ) ABC %>%   expand(condition) %>%   augment(m_ABC, newdata = ., se_fit = TRUE) %>%   ggplot(aes(y = condition)) +   stat_ccdfinterval(     aes(xdist = dist_student_t(df = df.residual(m_ABC), mu = .fitted, sigma = .se.fit))   ) ABC %>%   expand(condition) %>%   augment(m_ABC, newdata = ., se_fit = TRUE) %>%   ggplot(aes(y = condition)) +   stat_dots(     aes(xdist = dist_student_t(df = df.residual(m_ABC), mu = .fitted, sigma = .se.fit)),     quantiles = 100   )"},{"path":"http://mjskay.github.io/ggdist/articles/freq-uncertainty-vis.html","id":"for-a-fit-line","dir":"Articles","previous_headings":"","what":"For a fit line","title":"Frequentist uncertainty visualization","text":"principle reconstructing confidence distribution allows us use stat_lineribbon() construct uncertainty bands around regression fit lines. ’ll reconstruct example mtcars dataset vignette(\"tidy-brms\", package = \"tidybayes\"), using lm() instead: ’ll use tidyr::expand() broom::tidy(), now ’ll employ stat_lineribbon():  Another alternative using alpha create gradations lineribbon colors different groups use fill_ramp aesthetic provided ggdist “ramp” fill color ribbons \"white\" full color (see help(\"scale_fill_ramp\")). ’ll “whiten” fill color band according level (level variable computed stat_lineribbon() ordered factor version .width):  One way avoid problems created overlapping ribbons (besides using alpha, ) use commutative blending modes available R > 4.2. ggblend package enables support blending modes, documentation includes examples use stat_lineribbon(). examples using lineribbons, see vignette(\"lineribbon\").","code":"m_mpg = lm(mpg ~ hp * cyl, data = mtcars) mtcars %>%   group_by(cyl) %>%   expand(hp = seq(min(hp), max(hp), length.out = 101)) %>%   augment(m_mpg, newdata = ., se_fit = TRUE) %>%   ggplot(aes(x = hp, fill = ordered(cyl), color = ordered(cyl))) +   stat_lineribbon(     aes(ydist = dist_student_t(df = df.residual(m_mpg), mu = .fitted, sigma = .se.fit)),     alpha = 1/4   ) +   geom_point(aes(y = mpg), data = mtcars) +   scale_fill_brewer(palette = \"Set2\") +   scale_color_brewer(palette = \"Dark2\") +   labs(     color = \"cyl\",     fill = \"cyl\",     y = \"mpg\"   ) mtcars %>%   group_by(cyl) %>%   expand(hp = seq(min(hp), max(hp), length.out = 101)) %>%   augment(m_mpg, newdata = ., se_fit = TRUE) %>%   ggplot(aes(x = hp, color = ordered(cyl))) +   stat_lineribbon(aes(     ydist = dist_student_t(df = df.residual(m_mpg), mu = .fitted, sigma = .se.fit),     fill = ordered(cyl),     fill_ramp = after_stat(level)   )) +   geom_point(aes(y = mpg), data = mtcars) +   scale_fill_brewer(palette = \"Set2\") +   scale_color_brewer(palette = \"Dark2\") +   labs(     color = \"cyl\",     fill = \"cyl\",     y = \"mpg\"   )"},{"path":"http://mjskay.github.io/ggdist/articles/lineribbon.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Lineribbon stats and geoms","text":"following vignette describes geom_lineribbon() family stats geoms ggdist, family stats geoms creating line+ribbon plots: example, plots fit line one uncertainty bands. vignette also describes curve_interval() function calculating curvewise (joint) intervals lineribbon plots.","code":""},{"path":"http://mjskay.github.io/ggdist/articles/lineribbon.html","id":"setup","dir":"Articles","previous_headings":"","what":"Setup","title":"Lineribbon stats and geoms","text":"following libraries required run vignette:","code":"library(dplyr) library(tidyr) library(ggdist) library(ggplot2) library(distributional) library(patchwork)  theme_set(theme_ggdist())"},{"path":"http://mjskay.github.io/ggdist/articles/lineribbon.html","id":"the-lineribbon-family","dir":"Articles","previous_headings":"","what":"The lineribbon family","title":"Lineribbon stats and geoms","text":"lineribbon family follows naming scheme larger family slabinterval geoms (see vignette(\"slabinterval\")). two members: geom_lineribbon() stat_lineribbon(). geom_lineribbon() can used data already summarized points intervals. sample data mapping values onto x y aesthetic. example, used draws posterior distribution lines/curves, bootstrap sampling distribution lines/curves, ensemble distribution, distribution, really. stat computes relevant summaries (points intervals) forwarding summaries geom_lineribbon(). analytical distributions mapping distributions onto xdist ydist aesthetic. takes distributional objects, posterior::rvar() objects, distribution names (dist aesthetic) arguments (args aesthetic arg1, … arg9 aesthetics) computes relevant slabs intervals. lineribbon geoms can plotted horizontally vertically. Depending aesthetics mapped, attempt automatically determine orientation; produce correct result, orientation can overridden setting orientation = \"horizontal\" orientation = \"vertical\".","code":""},{"path":"http://mjskay.github.io/ggdist/articles/lineribbon.html","id":"lineribbons-on-already-summarized-data","dir":"Articles","previous_headings":"","what":"Lineribbons on already-summarized data","title":"Lineribbon stats and geoms","text":"base lineribbon geometry can applied already-summarized data: data frames row contains point upper lower bounds interval. purposes example, first look generate data frame data frame sample data; data include Bayesian posterior distributions (examples usage, see vignettes tidybayes) bootstrap sampling distributions. simple example , ’ll just generate distribution lines manually: df 50,000-row data frame sample 5000 y values x value. represents sample 5000 lines. subsample 100 lines:  can summarize data frame x position using median_qi() (function point_interval() family): Given data summarized like , can construct line+ribbon chart using geom_lineribbon():  geom_lineribbon() automatically pulls .width column maps onto fill aesthetic intervals different widths get different colors. However, result just one interval great, default color scheme quite dark just one color. Let’s make two changes improve chart: use .width argument median_qi() generate multiple uncertainty bands (50%, 80%, 95% band). use scale_fill_brewer() get nicer color scheme. result looks like :","code":"set.seed(1234) n = 5000  df = tibble(   .draw = 1:n,   intercept = rnorm(n, 3, 1),   slope = rnorm(n, 1, 0.25),   x = list(-4:5),   y = Map(function(x, y) x + y * -4:5, intercept, slope) ) %>%   unnest(c(x, y)) df %>%   filter(.draw %in% 1:100) %>%   ggplot(aes(x = x, y = y, group = .draw)) +   geom_line(alpha = 0.25) df %>%   group_by(x) %>%   median_qi(y) ## # A tibble: 10 × 7 ##        x       y    .lower .upper .width .point .interval ##    <int>   <dbl>     <dbl>  <dbl>  <dbl> <chr>  <chr>     ##  1    -4 -1.01   -3.71       1.61   0.95 median qi        ##  2    -3 -0.0149 -2.38       2.30   0.95 median qi        ##  3    -2  0.981  -1.14       3.07   0.95 median qi        ##  4    -1  2.00    0.000809   3.97   0.95 median qi        ##  5     0  2.99    1.07       4.94   0.95 median qi        ##  6     1  3.99    2.04       6.00   0.95 median qi        ##  7     2  4.99    2.88       7.14   0.95 median qi        ##  8     3  6.00    3.58       8.44   0.95 median qi        ##  9     4  7.00    4.25       9.81   0.95 median qi        ## 10     5  8.01    4.89      11.2    0.95 median qi df %>%   group_by(x) %>%   median_qi(y) %>%   ggplot(aes(x = x, y = y, ymin = .lower, ymax = .upper)) +   geom_lineribbon(fill = \"gray65\") df %>%   group_by(x) %>%   median_qi(y, .width = c(.50, .80, .95)) %>%   ggplot(aes(x = x, y = y, ymin = .lower, ymax = .upper)) +   geom_lineribbon() +   scale_fill_brewer()"},{"path":"http://mjskay.github.io/ggdist/articles/lineribbon.html","id":"lineribbons-on-sample-data","dir":"Articles","previous_headings":"","what":"Lineribbons on sample data","title":"Lineribbon stats and geoms","text":"apply lineribbons sample data, can also use stat_lineribbon() instead summarizing data first using median_qi() point_interval(). function summarization internally . Taking previous example, can simply removing lines summarize data first, omit aesthetic mappings onto ymin ymax, automatically set stat_lineribbon(). simplifies previous example considerably:  default .width setting stat_lineribbon() c(.50, .80, .95), can seen results . can change get sets number intervals (e.g., c(.66, .95), c(.80, .95, .99), etc).","code":"df %>%   ggplot(aes(x = x, y = y)) +   stat_lineribbon() +   scale_fill_brewer()"},{"path":"http://mjskay.github.io/ggdist/articles/lineribbon.html","id":"lineribbon-gradients","dir":"Articles","previous_headings":"Lineribbons on sample data","what":"Lineribbon “gradients”","title":"Lineribbon stats and geoms","text":"can also create gradient-like plots lineribbons passing large number probability levels .width parameter. Calling ppoints(n) generates n values 0 1 (exclusive), can used interval widths. must also override default fill aesthetic use .width generated variable, continuous (default lineribbons map level onto fill aesthetic, transformation .width factor—produces illegible legends many values used). also requires us use continuous fill scale (e.g. scale_fill_distiller()) instead discrete one (e.g. scale_fill_brewer()):  get gradient ramps background color, also use fill_ramp aesthetic provided ggdist (see help(\"scale_fill_ramp\")). necessary invert range (range = c(1, 0)) gradient dark middle (rather outside). default legend fill_ramp color_ramp scales guide_legend(), uses discrete legends even continuous scales. get gradient-style legend, use guide_rampbar(), necessary, use = argument specify color ramp legend (default \"gray65\"):  ’s worth noting use .width fill color means gradients akin classical “fan” charts; .e. fill color proportional folded CDF -called “confidence function”. may instead want fill color proportional density.","code":"df %>%   ggplot(aes(x = x, y = y, fill = after_stat(.width))) +   stat_lineribbon(.width = ppoints(50)) +   scale_fill_distiller() +   labs(title = \"stat_lineribbon(.width = ppoints(50))\") df %>%   ggplot(aes(x = x, y = y, fill_ramp = after_stat(.width))) +   stat_lineribbon(.width = ppoints(50), fill = \"#2171b5\") +   scale_fill_ramp_continuous(range = c(1, 0), guide = guide_rampbar(to = \"#2171b5\")) +   labs(     title = \"stat_lineribbon(.width = ppoints(50))\",     subtitle = 'aes(fill_ramp = after_stat(.width)) +\\nscale_fill_ramp_continuous(guide = \"rampbar\")'   )"},{"path":"http://mjskay.github.io/ggdist/articles/lineribbon.html","id":"lineribbon-density-gradients","dir":"Articles","previous_headings":"Lineribbons on sample data","what":"Lineribbon density gradients","title":"Lineribbon stats and geoms","text":"Making fill proportional density bit complicated achieve, can approximated using experimental feature latest version ggdist. feature exposes density CDF information interval sub-geometries. feature fragile fully supported across scenarios use, must enabled setting options(ggdist.experimental.slab_data_in_intervals = TRUE). Internally, feature enabled, ggdist calculates density lower (pdf_min) upper (pdf_max) ends intervals; can use average (just sum, since don’t need care normalizing constants) approximation density interval. averages must taken within values .width strip gets fill color, can done using ave() function, takes average first argument within groups second:  may notice steps gradient now look little “jumpy” near edges band: ppoints() function giving us even steps probability space (.e. CDF), even steps terms density. strictly necessary fix correctness color, visually appealing without jumpiness. can pick steps likely even density space using evenly-spaced z values translating probability levels using pnorm(). matter target distribution non-Normal, since actual densities still set using pdf_min pdf_max (colors still correct), closer distribution Normal less jumpy-looking gradient .  using different background color \"white\", can pass color argument scale_fill_ramp_continuous() ramp color fill color lineribbon.","code":"withr::with_options(list(ggdist.experimental.slab_data_in_intervals = TRUE), print(   df %>%     ggplot(aes(x = x, y = y, fill_ramp = after_stat(ave(pdf_min + pdf_max, .width)))) +     stat_lineribbon(.width = ppoints(50), fill = \"#2171b5\") +     scale_fill_ramp_continuous(name = \"density\", guide = guide_rampbar(to = \"#2171b5\")) +     labs(       title = \"stat_lineribbon(.width = ppoints(50))\",       subtitle = 'aes(fill_ramp = after_stat(ave(pdf_min + pdf_max, .width)))'     ) )) withr::with_options(list(ggdist.experimental.slab_data_in_intervals = TRUE), print(   df %>%     ggplot(aes(x = x, y = y, fill_ramp = after_stat(ave(pdf_min + pdf_max, .width)))) +     stat_lineribbon(.width = pnorm(seq(-2.5, 2.5, length.out = 50)), fill = \"#2171b5\") +     scale_fill_ramp_continuous(name = \"density\", guide = guide_rampbar(to = \"#2171b5\")) +     labs(       title = \"stat_lineribbon(.width = pnorm(seq(-2.5, 2.5, length.out = 50)))\",       subtitle = 'aes(fill_ramp = after_stat(ave(pdf_min + pdf_max, .width)))'     ) ))"},{"path":"http://mjskay.github.io/ggdist/articles/lineribbon.html","id":"multiple-lineribbons-on-one-plot","dir":"Articles","previous_headings":"Lineribbons on sample data","what":"Multiple lineribbons on one plot","title":"Lineribbon stats and geoms","text":"One may also want plot multiple lineribbons plot, perhaps corresponding separate groups. might require applying different color fill differentiate lineribbons. Consider data: naive approach plotting make lines hard distinguish:  Instead, change fill color allow lines semi-transparent:  also use fill_ramp aesthetic provided ggdist similar effect (see help(\"scale_fill_ramp\")), though tends work best lines overlap:  One way avoid problems created overlapping ribbons (besides using alpha, ) use commutative blending modes available R > 4.2. ggblend package enables support blending modes, documentation includes examples use stat_lineribbon(). situations, may also try controlling draw order ribbons directly, adjusting order aesthetic. default, order aesthetic specified, geom_lineribbon() draws ribbons widest average bottom. stat_lineribbon(), default, bit smarter, sets order aesthetic after_stat(level), using level computed variable draw ribbons order confidence / probability mass. alternative might draw ribbons group top , like :","code":"df_2groups = rbind(   mutate(df, g = \"a\"),   mutate(df, g = \"b\", y = (y - 2) * 0.5) ) df_2groups %>%   ggplot(aes(x = x, y = y, color = g)) +   stat_lineribbon() +   scale_fill_brewer() df_2groups %>%   ggplot(aes(x = x, y = y, fill = g)) +   stat_lineribbon(alpha = 1/4) +   labs(title = \"stat_lineribbon(aes(fill = g), alpha = 1/4)\") df_2groups %>%   ggplot(aes(x = x, y = y, fill = g)) +   stat_lineribbon(aes(fill_ramp = after_stat(level))) +   labs(title = \"stat_lineribbon(aes(fill = g, fill_ramp = after_stat(level)))\") df_2groups %>%   ggplot(aes(x = x, y = y, fill = g)) +   stat_lineribbon(aes(     fill_ramp = after_stat(level),     order = after_stat(interaction(level, group))   )) +   labs(title = \"stat_lineribbon(aes(order = after_stat(interaction(level, group))))\")"},{"path":"http://mjskay.github.io/ggdist/articles/lineribbon.html","id":"lineribbons-on-analytical-distributions","dir":"Articles","previous_headings":"","what":"Lineribbons on analytical distributions","title":"Lineribbon stats and geoms","text":"Lineribbons can also applied analytical distributions. use case often arises confidence distributions describing uncertainty fit line; example, see end vignette(\"freq-uncertainty-vis\"). , look simpler example construct distributions manually; ’ll assume variable y normally distributed conditional x mean y_mean standard deviation y_sd: can visualize conditional distribution using stat_lineribbon() distributional::dist_normal():","code":"analytical_df = tibble(   x = -4:5,   y_mean = 3 + x,   y_sd = sqrt(x^2/10 + 1) ) analytical_df ## # A tibble: 10 × 3 ##        x y_mean  y_sd ##    <int>  <dbl> <dbl> ##  1    -4     -1  1.61 ##  2    -3      0  1.38 ##  3    -2      1  1.18 ##  4    -1      2  1.05 ##  5     0      3  1    ##  6     1      4  1.05 ##  7     2      5  1.18 ##  8     3      6  1.38 ##  9     4      7  1.61 ## 10     5      8  1.87 analytical_df %>%   ggplot(aes(x = x, ydist = dist_normal(y_mean, y_sd))) +   stat_lineribbon() +   scale_fill_brewer()"},{"path":"http://mjskay.github.io/ggdist/articles/lineribbon.html","id":"more-examples","dir":"Articles","previous_headings":"","what":"More examples","title":"Lineribbon stats and geoms","text":"examples lineribbons, including multiple lineribbons plot, see examples end vignette(\"freq-uncertainty-vis\").","code":""},{"path":"http://mjskay.github.io/ggdist/articles/lineribbon.html","id":"curve-boxplots-aka-lineribbons-with-joint-intervals-or-curvewise-intervals","dir":"Articles","previous_headings":"","what":"Curve boxplots (aka lineribbons with joint intervals or curvewise intervals)","title":"Lineribbon stats and geoms","text":"examples calculate conditional intervals, either using point_interval() (directly indirectly) using quantiles analytical distribution. However, may always want conditional intervals. point_interval() calculates pointwise intervals, intervals conditional group, curve_interval() calculates joint curvewise intervals. literature also called curve boxplots (Mirzargar et al. 2014, Juul et al. 2020). example help illustrate difference two types intervals. Consider following set curves, curve assumed “draw” distribution curves, \\(\\mathbf{y} = f(\\mathbf{x})\\), \\(\\mathbf{x}\\) \\(\\mathbf{y}\\) vectors:  one used one point_interval() functions summarize curve (median_qi(), mean_qi(), etc), calculate pointwise intervals:  50% pointwise interval calculated (say) \\(x = 1\\) contain 50% draws \\(y|x=1\\). different value \\(x\\), say \\(x = 2\\), 50% pointwise interval also contain 50% draws \\(y|x = 2\\). However, specific draws contained interval \\(y|x=2\\) might different draws contained interval \\(x|y=1\\): trace underlying curves, notice curve included intervals included others. Thus, set intervals—ribbon—may fully contain 50% curves. Indeed, inspecting plot, 50% ribbon contains none curves! Depending type inference care , might sufficient purposes: maybe interested just outcome likely given x value (conditional inference), interested joint inferences (e.g., shape curve likely look like?). However, interested joint inferences, pointwise intervals can misleading. shape median curve, example, looks nothing like possible outcomes. interval also include maximum value underlying curves, might cause us conclude (incorrectly) value close 1 unlikely, exact opposite case (every curve touches 1). One solution like situations show spaghetti plots: just plot underlying curves. -called frequency framing uncertainty visualization, tends work fairly well. However, cases may want visual summary using intervals, case curvewise intervals help. Using curve_interval() instead point_interval() median_qi() calculates :  Note 50% curvewise interval now contains half underlying curves, median curve one underlying curves (representative curve shape expect). intervals also cover peaks curves, pointwise intervals . X% curvewise interval calculated across curves taking top X% closest curves central curve, definition “close” “central”. curve_interval() function currently orders curves mean halfspace depth, basically close curve pointwise median percentiles, average. Given , let’s see realistic curvewise intervals example might look like using larger number draws:  Notice pointwise intervals miss peaks distribution curves. Even 95% ribbon, appears reach peaks, fact falls slightly short. bit pathological example, demonstrate potential shortcomings pointwise intervals.","code":"k = 11 # number of curves n = 501 df = tibble(   .draw = 1:k,   mean = seq(-5, 5, length.out = k),   x = list(seq(-15, 15, length.out = n)) ) %>%   unnest(x) %>%   mutate(y = dnorm(x, mean, 3)/max(dnorm(x, mean, 3)))  df %>%   ggplot(aes(x = x, y = y)) +   geom_line(aes(group = .draw), alpha = 0.2) df %>%   group_by(x) %>%   median_qi(y, .width = .5) %>%   ggplot(aes(x = x, y = y)) +   geom_lineribbon(aes(ymin = .lower, ymax = .upper)) +   geom_line(aes(group = .draw), alpha = 0.15, data = df) +   scale_fill_brewer() +   ggtitle(\"50% pointwise intervals with point_interval()\") df %>%   group_by(x) %>%   curve_interval(y, .width = .5) %>%   ggplot(aes(x = x, y = y)) +   geom_lineribbon(aes(ymin = .lower, ymax = .upper)) +   geom_line(aes(group = .draw), alpha = 0.15, data = df) +   scale_fill_brewer() +   ggtitle(\"50% curvewise intervals with curve_interval()\") k = 1000 # number of curves large_df = tibble(   .draw = 1:k,   mean = seq(-5,5, length.out = k),   x = list(seq(-15,15,length.out = n)) ) %>%   unnest(x) %>%   mutate(y = dnorm(x, mean, 3)/max(dnorm(x, mean, 3)))  pointwise_plot = large_df %>%   group_by(x) %>%   median_qi(y, .width = c(.5, .8, .95)) %>%   ggplot(aes(x = x, y = y)) +   geom_hline(yintercept = 1, color = \"gray75\", linetype = \"dashed\") +   geom_lineribbon(aes(ymin = .lower, ymax = .upper)) +   scale_fill_brewer() +   ggtitle(\"point_interval()\")  curvewise_plot = large_df %>%   group_by(x) %>%   curve_interval(y, .width = c(.5, .8, .95)) %>%   ggplot(aes(x = x, y = y)) +   geom_hline(yintercept = 1, color = \"gray75\", linetype = \"dashed\") +   geom_lineribbon(aes(ymin = .lower, ymax = .upper)) +   scale_fill_brewer() +   ggtitle(\"curve_interval()\")  pointwise_plot / curvewise_plot"},{"path":"http://mjskay.github.io/ggdist/articles/lineribbon.html","id":"limitations-of-curvewise-intervals","dir":"Articles","previous_headings":"Curve boxplots (aka lineribbons with joint intervals or curvewise intervals)","what":"Limitations of curvewise intervals","title":"Lineribbon stats and geoms","text":"One challenge curvewise intervals can tend conservative, especially moderate--large intervals widths. Let’s bootstrap LOESS fits horsepower versus MPG mtcars dataset: pretty naive approach, definitely great way analyzing data, illustrate problems kinds problems might get joint intervals. Let’s look spaghetti plot just 400 draws bootstrap distribution first:  Now, pointwise intervals:  Finally, curvewise intervals:  Notice noisy curvewise intervals . addition, number curves tend start low end high (vice versa), 50%, bands rapidly expand cover almost curves sample, regardless coverage level. can try different methods sometimes get improved bands; e.g. using \"bd-mbd\" method per Sun Genton (2011) works better dataset:  general found one method consistently works well datasets. matter method, intervals often become problematic 50%, hence default .width curve_interval() 0.5 (unlike default point_interval(), 0.95). case, caution using intervals advised.","code":"set.seed(1234) n = 4000 mpg = seq(min(mtcars$mpg), max(mtcars$mpg), length.out = 100)  mtcars_boot = tibble(   .draw = 1:n,   m = lapply(.draw, function(d) loess(     hp ~ mpg,     span = 0.9,     # this lets us predict outside the range of the data     control = loess.control(surface = \"direct\"),     data = slice_sample(mtcars, prop = 1, replace = TRUE)   )),   hp = lapply(m, predict, newdata = tibble(mpg)),   mpg = list(mpg) ) %>%   select(-m) %>%   unnest(c(hp, mpg)) mtcars_boot %>%   filter(.draw < 400) %>%   ggplot(aes(x = mpg, y = hp)) +   geom_line(aes(group = .draw), alpha = 1/10) +   geom_point(data = mtcars) +   coord_cartesian(ylim = c(0, 400)) mtcars_boot %>%   ggplot(aes(x = mpg, y = hp)) +   stat_lineribbon(.width = c(.5, .7, .9)) +   geom_point(data = mtcars) +   scale_fill_brewer() +   coord_cartesian(ylim = c(0, 400)) mtcars_boot %>%   group_by(mpg) %>%   curve_interval(hp, .width = c(.5, .7, .9)) %>%   ggplot(aes(x = mpg, y = hp)) +   geom_lineribbon(aes(ymin = .lower, ymax = .upper)) +   geom_point(data = mtcars) +   scale_fill_brewer() +   coord_cartesian(ylim = c(0, 400)) mtcars_boot %>%   group_by(mpg) %>%   curve_interval(hp, .width = c(.5, .7, .9), .interval = \"bd-mbd\") %>%   ggplot(aes(x = mpg, y = hp)) +   geom_lineribbon(aes(ymin = .lower, ymax = .upper)) +   geom_point(data = mtcars) +   scale_fill_brewer() +   coord_cartesian(ylim = c(0, 400))"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Slab + interval stats and geoms","text":"vignette describes slab+interval geoms stats ggdist. flexible family stats geoms designed make plotting distributions (priors posteriors Bayesian models, even sampling distributions models) straightforward, support range useful plots, including intervals, eye plots (densities + intervals), CCDF bar plots (complementary cumulative distribution functions + intervals), gradient plots, histograms.","code":""},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"setup","dir":"Articles","previous_headings":"","what":"Setup","title":"Slab + interval stats and geoms","text":"following libraries required run vignette:","code":"library(dplyr) library(tidyr) library(distributional) library(ggdist) library(ggplot2) library(patchwork)  theme_set(theme_ggdist())"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"roadmap-the-slabinterval-meta-geometry","dir":"Articles","previous_headings":"","what":"Roadmap: The slabinterval meta-geometry","title":"Slab + interval stats and geoms","text":"ggdist pantheon geoms stats stem common root: geom_slabinterval() stat_slabinterval(). geoms consist “slab” (say, density CDF), one intervals, point summary. components may computed number different ways, different variants geom include components. base geom_slabinterval() uses variety custom aesthetics create composite geometry:  Depending whether want horizontal vertical orientation, can provide ymin ymax instead xmin xmax. default, aesthetics (e.g., fill, color, size, alpha) set properties multiple sub-geometries . example, color aesthetic default sets color point interval, can also overridden point_color interval_color set color sub-geometry separately. geom_slabinterval() useful paired stat_slabinterval(), automatically calculate intervals, densities, cumulative distribution functions, maps onto endpoints interval sub-geometry thickness slab sub-geometry. scaling slab thickness determined combination geometry’s height/width, scale, normalize parameter, thickness scales added plot (scale_thickness_shared()). comprehensive discussion examples slab scaling normalization, see thickness scale article. Using geom_slabinterval() stat_slabinterval() directly always advisable: highly configurable , configurability requires remembering number combinations options use. quick plotting, ggdist contains number pre-configured, easier--remember shortcut stats geoms built top slabinterval: Shortcut geoms, starting geom_, meant used already-summarized data: geom_pointinterval() geom_interval() (data summarized intervals) geom_slab() (data summarized function values, like densities cumulative distribution functions). Shortcut stats, starting stat_, compute relevant summaries (densities, CDFs, points, /intervals) forwarding summaries geom. geom counterparts (e.g. stat_interval() corresponds geom_interval(), except former applies sample data latter already-summarized data). Many stats currently geom counterparts (e.g. stat_ccdfinterval()), primarily differentiated based kind statistical summary compute. ’ve already computed function (density CDF), can just use geom_slabinterval() directly. stats can used two types data, depending aesthetic mappings provide: Sample data; e.g. draws data distribution, bootstrap distribution, Bayesian posterior distribution (distribution, really). use stats sample data, map sample values onto x y aesthetic. Distribution objects analytical distributions. use stats type data, must use xdist, ydist aesthetics, take distributional objects, posterior::rvar() objects, distribution names (e.g. \"norm\", refers Normal distribution provided dnorm/pnorm/qnorm functions). slabinterval geoms can plotted horizontally vertically. Depending aesthetics mapped, attempt automatically determine orientation; produce correct result, orientation can overridden setting orientation = \"horizontal\" orientation = \"vertical\". ’ll start one common existing use cases kinds geoms: eye plots.","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"on-sample-data","dir":"Articles","previous_headings":"Eye plots and half-eye plots","what":"On sample data","title":"Slab + interval stats and geoms","text":"Eye plots combine densities (violins) intervals give detailed picture uncertainty available just looking intervals. first demos ’ll use data: can summarize group level using “half-eye” plot, combines density plot intervals (ignoring subgroups now):  can use side parameter finely control slab (case, density) drawn; stat_eye() also shortcut stat_slabinterval(side = \"\"), creates “eye” plots:  Note chart drawn vertically instead horizontally: slabinterval geoms automatically detect orientation based input data. example, used factor x axis , geoms drawn along axis (y axis). automatic detection desired axis fails, can specify manually; e.g. stat_halfeye(orientation = 'vertical') stat_halfeye(orientation = 'horizontal'). side parameter works horizontal geoms well. \"top\" \"right\" considered synonyms, \"bottom\" \"left\"; either form works horizontal vertical versions geoms:  slabinterval geoms support dodging standard mechanism position = \"dodge\". Unlike geom_violin(), densities groups dodged (, ‘’ ‘b’) area max width groups dodged (‘c’):  Dodging works whether geoms horizontal vertical.","code":"set.seed(1234) df = tribble(   ~group, ~subgroup, ~value,   \"a\",          \"h\", rnorm(1000, mean = 5),   \"b\",          \"h\", rnorm(1000, mean = 7, sd = 1.5),   \"c\",          \"h\", rnorm(1000, mean = 8),   \"c\",          \"i\", rnorm(1000, mean = 9),   \"c\",          \"j\", rnorm(1000, mean = 7) ) %>%   unnest(value) df %>%   ggplot(aes(y = group, x = value)) +   stat_halfeye() +   ggtitle(\"stat_halfeye() (or stat_slabinterval())\") p = df %>%   ggplot(aes(x = group, y = value)) +   theme(panel.background = element_rect(color = \"grey70\"))  (   p + stat_slabinterval(side = \"left\") +     labs(title = \"stat_slabinterval()\", subtitle = \"side = 'left'\") ) + (   p + stat_slabinterval(side = \"both\") +     labs(subtitle = \"side = 'both'\") ) + (   p + stat_slabinterval(side = \"right\") +     labs(subtitle = \"side = 'right'\") ) p = df %>%   ggplot(aes(x = value, y = group)) +   theme(panel.background = element_rect(color = \"grey70\"))  (   # side = \"left\" would give the same result   p + stat_slabinterval(side = \"left\") +     ggtitle(\"stat_slabinterval()\") + labs(subtitle = \"side = 'bottom'\") ) + (   p + stat_slabinterval(side = \"both\") + labs(subtitle = \"side = 'both'\") ) + (   # side = \"right\" would give the same result   p + stat_slabinterval(side = \"right\") + labs(subtitle = \"side = 'top'\") ) df %>%   ggplot(aes(x = group, y = value, fill = subgroup)) +   stat_eye(position = \"dodge\") +   ggtitle(\"stat_eye(position = 'dodge')\")"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"on-analytical-distributions","dir":"Articles","previous_headings":"Eye plots and half-eye plots","what":"On analytical distributions","title":"Slab + interval stats and geoms","text":"set (half-)eye plot stats designed sample data described can used analytical distributions distribution vectors using xdist/ydist aesthetics instead x/y. stats accept specifications distributions one two ways: Using distribution vectors distributional package posterior::rvar() objects: format uses aesthetics follows: xdist, ydist, dist: distribution vector posterior::rvar() produced functions distributional::dist_normal(), distributional::dist_beta(), posterior::rvar_rng(), etc. Using distribution names character vectors: older, soft-deprecated format included backwards-compatibility, generally recommended new code. format uses aesthetics follows: xdist, ydist, dist: name distribution, following R’s naming scheme. string \"p\", \"q\", \"d\" functions defined : e.g., “norm” valid distribution name pnorm(), qnorm(), dnorm() functions define CDF, quantile function, density function Normal distribution. args arg1, …, arg9: arguments distribution. use args, list column element list containing arguments distribution functions; alternatively, can pass arguments directly using arg1, …, arg9. example, variety normal distributions describing data previous section: can use distributional::dist_normal() function construct vector normal distributions means standard deviations, map ydist aesthetic, sets distributions drawn along y axis:  Distributional vectors, combined xdist ydist aesthetics, make easy visualize variety distributions. E.g., Beta distributions:  want plot top (instead stacked), turn plotting interval make plot easier read using stat_slabinterval(show_interval = FALSE, ...). shortcut stat_slabinterval(show_interval = FALSE, ...) stat_slab(). ’ll also turn fill color fill = NA make stacking easier see, use outline color show value alpha:","code":"dist_df = tribble(   ~group, ~subgroup, ~mean, ~sd,   \"a\",          \"h\",     5,   1,   \"b\",          \"h\",     7,   1.5,   \"c\",          \"h\",     8,   1,   \"c\",          \"i\",     9,   1,   \"c\",          \"j\",     7,   1 ) dist_df %>%   ggplot(aes(x = group, ydist = dist_normal(mean, sd), fill = subgroup)) +   stat_eye(position = \"dodge\") +   ggtitle(\"stat_eye(position = 'dodge')\", \"aes(ydist = dist_normal(mean, sd))\") data.frame(alpha = seq(5, 100, length.out = 10)) %>%   ggplot(aes(y = alpha, xdist = dist_beta(alpha, 10))) +   stat_halfeye() +   labs(     title = \"stat_halfeye()\",     subtitle = \"aes(xdist = dist_beta(alpha, 10), y = alpha)\",     x = \"Beta(alpha,10) distribution\"   ) data.frame(alpha = seq(5, 100, length.out = 10)) %>%   ggplot(aes(xdist = dist_beta(alpha, 10), color = alpha)) +   stat_slab(fill = NA) +   coord_cartesian(expand = FALSE) +   scale_color_viridis_c() +   labs(     title = \"stat_slab()\",     subtitle = \"aes(xdist = dist_beta(alpha, 10), color = alpha)\",     x = \"Beta(alpha,10) distribution\",     y = NULL   )"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"visualizing-frequentist-uncertainty","dir":"Articles","previous_headings":"Eye plots and half-eye plots","what":"Visualizing frequentist uncertainty","title":"Slab + interval stats and geoms","text":"Distributional vectors also make easy visualize frequentist confidence distributions, often Normal Student’s t distributions. examples , see vignette(\"freq-uncertainty-vis\").","code":""},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"visualizing-priors","dir":"Articles","previous_headings":"Eye plots and half-eye plots","what":"Visualizing priors","title":"Slab + interval stats and geoms","text":"particularly good use xdist/ydist aesthetics visualize priors. example, brms can specify priors using brms::prior() function, creates data frames \"prior\" column indicating name prior distribution string. E.g., one might set priors betas standard deviation model something like : parse_dist() function can make easier visualize : takes string specifications like produced brms — \"normal(0,1)\" \"lognormal(0,1)\" — translates .dist, .args, .dist_obj columns: Notice also automatically translates common distribution names (e.g. “normal”) equivalent R function names (\"norm\"). also creates .dist_obj vector using distributional::dist_wrap(). distribution vector respects truncation bounds set lb ub columns output brms::prior(), half-Normal prior sigma parameter. .dist_obj vector can assigned xdist ydist aesthetic ggdist:  example also demonstrates use subguides label thickness axis. subguides, see documentation subguide_axis() function, scaling thickness aesthetic, see thickness article. format() function format(.dist_obj) generates string containing human-readable name distribution labeling purposes.","code":"# NB these priors are made up! priors = c(   prior(normal(1, 0.5), class = b),   prior(gamma(2, 2), class = phi),   # lb = 0 sets a lower bound of 0, i.e. a half-Normal distribution   prior(normal(0, 1), class = sigma, lb = 0) ) priors ##            prior class coef group resp dpar nlpar   lb ub ## 1 normal(1, 0.5)     b                            <NA> NA ## 2    gamma(2, 2)   phi                            <NA> NA ## 3   normal(0, 1) sigma                               0 NA priors %>%   parse_dist(prior) ##            prior class coef group resp dpar nlpar   lb ub .dist    .args         .dist_obj ## 1 normal(1, 0.5)     b                            <NA> NA  norm 1.0, 0.5      norm(1, 0.5) ## 2    gamma(2, 2)   phi                            <NA> NA gamma     2, 2       gamma(2, 2) ## 3   normal(0, 1) sigma                               0 NA  norm     0, 1 norm(0, 1)[0,Inf] priors %>%   parse_dist(prior) %>%   ggplot(aes(y = paste(class, \"~\", format(.dist_obj)), xdist = .dist_obj)) +   stat_halfeye(subguide = subguide_inside(position = \"right\", title = \"density\")) +   labs(     title = \"stat_halfeye()\",     subtitle = \"with parse_dist() and brms::prior() to show priors\",     x = NULL,     y = NULL   )"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"sharing-thickness-scaling-across-geometries","dir":"Articles","previous_headings":"Eye plots and half-eye plots","what":"Sharing thickness scaling across geometries","title":"Slab + interval stats and geoms","text":"cases, visualizing priors posteriors, can helpful use multiple geometries (e.g. one prior one posterior). default, normalization/scaling slab thicknesses controlled geometries, scale function. allows various functionality otherwise possible, (1) allowing different geometries different thickness scales (2) allowing user control level aggregation (panels, groups, entire plot, etc) thickness scaling done via normalize parameter [geom_slabinterval()]. override default behavior make separate geometries use shared thickness scale, add scale_thickness_shared() plot. difference illustrated :  scale_thickness_shared() applied, densities area curves. details scaling thickness aesthetic discussed thickness article","code":"prior_post = data.frame(   prior = dist_normal(0, 1),   posterior = dist_normal(0.1, 0.5) )  separate_scale_plot = prior_post %>%   ggplot() +   stat_halfeye(aes(xdist = posterior)) +   stat_slab(aes(xdist = prior), fill = NA, color = \"red\") +   labs(     subtitle = \"default: no shared thickness scale\"   )  shared_scale_plot = prior_post %>%   ggplot() +   stat_halfeye(aes(xdist = posterior)) +   stat_slab(aes(xdist = prior), fill = NA, color = \"#e41a1c\") +   scale_thickness_shared() +   labs(subtitle = \"with scale_thickness_shared()\")  separate_scale_plot + shared_scale_plot + plot_annotation(title = \"prior (slab) + posterior (halfeye)\")"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"scale-transformations-of-densities","dir":"Articles","previous_headings":"Eye plots and half-eye plots","what":"Scale transformations of densities","title":"Slab + interval stats and geoms","text":"stat_slabinterval() family also adjusts densities appropriately scale transformations applied. example, log-Normal distribution plotted log scale:  expected, log-Normal density plotted log scale appears Normal. Jacobian correction scale transformation applied density correct density shown log scale. Internally, ggdist attempts symbolic differentiation scale transformation functions (fails, uses numerical differentiation) calculate Jacobian stat_slabinterval() family works generically across different scale transformations supported ggplot.","code":"data.frame(dist = dist_lognormal(log(10), 2*log(10))) %>%   ggplot(aes(xdist = dist)) +   stat_halfeye() +   scale_x_log10(breaks = 10^seq(-5,7, by = 2))"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"summing-up-eye-plots-stat_halfeye","dir":"Articles","previous_headings":"Eye plots and half-eye plots","what":"Summing up eye plots: stat_[half]eye","title":"Slab + interval stats and geoms","text":"stats section follow naming scheme stat_[half]eye, adding half name yields half-eyes (density plots) instead eyes (violins). Like remaining shortcut stats, stats also follow conventions: Map sample values x y use stats sample data. Use xdist, ydist, args aesthetics analytical distributions distributions contained vector objects, distributional posterior::rvar() objects.","code":""},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"histogram-interval-plots","dir":"Articles","previous_headings":"","what":"Histogram + interval plots","title":"Slab + interval stats and geoms","text":"cases might prefer histograms density plots. stat_histinterval() provides alternative stat_halfeye() uses histograms instead densities; roughly equivalent stat_slabinterval(density = \"histogram\"):  can use slab_color aesthetic show outline bars. default outlines drawn along tops bars, typical tasks histograms involve area estimation, outlines bars strictly necessary may distracting. However, wish include outlines, can set outline_bars = TRUE:","code":"p = df %>%   ggplot(aes(x = group, y = value)) +   theme(panel.background = element_rect(color = \"grey70\"))  ph = df %>%   ggplot(aes(y = group, x = value)) +   theme(panel.background = element_rect(color = \"grey70\"))  (   p + stat_histinterval() + labs(title = \"stat_histinterval()\", subtitle = \"horizontal\") ) + (   ph + stat_histinterval() + labs(subtitle = \"vertical\") ) (   ph + stat_histinterval(slab_color = \"gray45\", outline_bars = FALSE) +     labs(title = \"stat_histinterval\", subtitle = \"outline_bars = FALSE (default)\") ) + (   ph + stat_histinterval(slab_color = \"gray45\", outline_bars = TRUE) +     labs(subtitle = \"outline_bars = TRUE\") )"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"histograms-of-analytical-distributions","dir":"Articles","previous_headings":"Histogram + interval plots","what":"Histograms of analytical distributions","title":"Slab + interval stats and geoms","text":"stat_histinterval() produce histograms continuous analytical distributions, stat_slabinterval() family automatically detect discrete distributions supplied xdist ydist aesthetics plot using stepped histograms instead densities. stat_histinterval(), can choose whether draw outlines bars histogram using outline_bars = TRUE FALSE (default FALSE). example histograms analytical distributions also shows redundant encoding density mapping pdf computed variable onto fill (addition default mapping onto thickness):  inspired example Isabella Ghement.","code":"tibble(   group = c(\"a\",\"b\",\"c\",\"d\",\"e\"),   lambda = c(13,7,4,3,2) ) %>%   ggplot(aes(x = group)) +   stat_slab(aes(ydist = dist_poisson(lambda), fill = after_stat(pdf))) +   geom_line(aes(y = lambda, group = NA), linewidth = 1) +   geom_point(aes(y = lambda), size = 2.5) +   labs(fill = \"Pr(y)\") +   ggtitle(\"stat_slab()\", \"aes(ydist = dist_poisson(lambda), fill = after_stat(pdf))\")"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"ccdf-bar-plots","dir":"Articles","previous_headings":"","what":"CCDF bar plots","title":"Slab + interval stats and geoms","text":"Another (perhaps sorely underused) technique visualizing distributions cumulative distribution functions (CDFs) complementary CDFs (CCDFs). can effective decision-making tasks densities intervals, require fewer assumptions create sample data density plots. examples , sample data analytical distributions, can replace slabinterval [c]cdfinterval get stat creates CDF CCDF bar plot. stat_ccdfinterval() roughly equivalent stat_slabinterval(aes(thickness = after_stat(1 - cdf)), justification = 0.5, side = \"topleft\", normalize = \"none\", expand = TRUE)","code":""},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"on-sample-data-1","dir":"Articles","previous_headings":"CCDF bar plots","what":"On sample data","title":"Slab + interval stats and geoms","text":"CCDF interval plots probably useful CDF interval plots cases, bars typically grow baseline. example, replacing stat_eye() stat_ccdfinterval() previous subgroup plot produces CCDF bar plots:  extents bars determined automatically range data samples. However, bar charts often good practice draw bars meaningful reference point (point often 0). can use ggplot2::expand_limits() ensure bar drawn 0. Let’s also adjust position slab relative position interval using justification parameter:  parameters, like orientation side, work way basic stat_slabinterval().","code":"df %>%   ggplot(aes(x = group, y = value, fill = subgroup, group = subgroup)) +   stat_ccdfinterval(position = \"dodge\") +   ggtitle(\"stat_ccdfinterval(position = 'dodge')\") df %>%   ggplot(aes(x = group, y = value, fill = subgroup)) +   stat_ccdfinterval(position = \"dodge\", justification = 1) +   expand_limits(y = 0) +   coord_cartesian(expand = FALSE) +   ggtitle(\"stat_ccdfinterval(position = 'dodge', justification = 1)\")"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"on-analytical-distributions-1","dir":"Articles","previous_headings":"CCDF bar plots","what":"On analytical distributions","title":"Slab + interval stats and geoms","text":"plot types, can also use stat_ccdfinterval()/stat_cdfinterval() visualize analytical distributions distribution vectors, using xdist ydist aesthetic (see previous examples).","code":""},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"summing-up-cdf-bar-plots","dir":"Articles","previous_headings":"CCDF bar plots","what":"Summing up CDF bar plots","title":"Slab + interval stats and geoms","text":"stats section follow naming scheme stat_[c]cdfinterval: Add c name get CCDFs instead CDFs. Use xdist/ydist instead x/y use stats analytical distributions distribution vectors instead sample data. can helpful use expand_limits() ensure meaningful reference points included plot.","code":""},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"gradient-plots","dir":"Articles","previous_headings":"","what":"Gradient plots","title":"Slab + interval stats and geoms","text":"alternative approach mapping density onto thickness aesthetic slab instead map onto alpha value (.e., opacity). stat_gradientinterval family (actually, uses slab_alpha, variant alpha aesthetic, described ). roughly equivalent stat_slabinterval(aes(slab_alpha = after_stat(f)), thickness = 1, justification = 0.5).","code":""},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"on-sample-data-2","dir":"Articles","previous_headings":"Gradient plots","what":"On sample data","title":"Slab + interval stats and geoms","text":"example, replacing stat_eye() stat_gradientinterval() produces gradient + interval plots:  stat_gradientinterval() maps density onto slab_alpha aesthetic, variant ggplot alpha scale specifically targets alpha (opacity) values slab portion geom_slabinterval(). aesthetic default ranges limits little different base ggplot alpha scale ensure densities 0 mapped onto opacities 0. can use scale_slab_alpha_continuous() adjust scale’s settings.","code":"df %>%   ggplot(aes(x = group, y = value, fill = subgroup)) +   stat_gradientinterval(position = \"dodge\") +   labs(title = \"stat_gradientinterval(position = 'dodge')\")"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"avoiding-choppy-looking-gradients","dir":"Articles","previous_headings":"Gradient plots","what":"Avoiding “choppy”-looking gradients","title":"Slab + interval stats and geoms","text":"Depending graphics device, gradients may “choppy” looking. can fix choppiness setting fill_type = \"gradient\", uses gradient feature introduced graphics engines R 4.1. use stat_gradientinterval() R 4.1, receive message suggesting may want explicitly set fill_type = \"gradient\" improve output quality. using R 4.2 greater, need set fill_type = \"gradient\" support gradients can auto-detected version, get warning message use stat_gradientinterval() graphics engine support gradients.  writing, R version 4.1 greater graphics devices support gradients — .e. device support grid::linearGradient() function — include pdf(), svg(), png(type = \"cairo\"). See changes R graphics engine.","code":"df %>%   ggplot(aes(x = group, y = value, fill = subgroup)) +   stat_gradientinterval(position = \"dodge\", fill_type = \"gradient\") +   labs(title = \"stat_gradientinterval(position = 'dodge', fill_type = 'gradient')\")"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"on-analytical-distributions-2","dir":"Articles","previous_headings":"Gradient plots","what":"On analytical distributions","title":"Slab + interval stats and geoms","text":"plot types, can also use stat_gradientinterval() visualize analytical distributions distribution vectors, using xdist ydist aesthetic (see previous examples).","code":""},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"dotplots","dir":"Articles","previous_headings":"","what":"Dotplots","title":"Slab + interval stats and geoms","text":"encodings thus far continuous probability encodings: map probabilities probability densities onto aesthetics like x/y position alpha transparency. alternative discrete frequency-framing uncertainty visualizations, dotplots quantile dotplots. Dotplots represent distributions showing data point, quantile dotplots extend idea analytical distributions showing quantiles distribution number discrete possible outcomes.","code":""},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"on-sample-data-3","dir":"Articles","previous_headings":"Dotplots","what":"On sample data","title":"Slab + interval stats and geoms","text":"example, replacing stat_halfeye() stat_dots() produces dotplots. many dots , outlines mask fill, makes sense map subgroup outline color dots well:  Unlike base ggplot2::geom_dotplot() geom, ggdist::geom_dots() automatically determines bin width ensure dot stacks fit within available space. can set binwidth parameter manually override .","code":"df %>%   ggplot(aes(x = group, y = value, fill = subgroup, color = subgroup)) +   stat_dots(position = \"dodgejust\") +   labs(     title = \"stat_dots()\",     subtitle = \"aes(fill = subgroup, color = subgroup))\"   )"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"quantile-dotplots","dir":"Articles","previous_headings":"Dotplots","what":"Quantile dotplots","title":"Slab + interval stats and geoms","text":"plots bit hard read due large number dots. Particularly summarizing posterior distributions predictive distributions, may thousands data points, can make sense plot smaller number dots (say 20, 50 100) representative full sample. One approach plot quantiles, thereby creating quantile dotplots, can help people make better decisions uncertainty (Kay 2016, Fernandes 2018). quantiles argument stat_dots constructs quantile dotplot specified number quantiles. one 50 quantiles, dot represents approximately 2% (1/50) chance. ’ll turn outline color (color = NA):  dotplots, see vignette(\"dotsinterval\")","code":"df %>%   ggplot(aes(x = group, y = value, fill = subgroup)) +   stat_dots(position = \"dodgejust\", quantiles = 50, color = NA) +   labs(title = \"stat_dots(quantiles = 50)\")"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"custom-plots","dir":"Articles","previous_headings":"","what":"Custom plots","title":"Slab + interval stats and geoms","text":"slabinterval family stats geoms designed flexible. shortcut geoms can created simply setting particular combinations options aesthetic mappings using basic geom_slabinterval() stat_slabinterval(). useful combinations specific shortcut geoms currently, can created manually bit additional effort.","code":""},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"gradients-of-alpha-color-and-fill","dir":"Articles","previous_headings":"Custom plots","what":"Gradients of alpha, color, and fill","title":"Slab + interval stats and geoms","text":"Two aesthetics particular use creating custom geoms slab_alpha, changes alpha transparency slab portion geom, slab_color, changes outline color, fill, changes fill color. aesthetics can mapped variables along length geom (, color constant entire geom), allows create gradients highlight meaningful regions data (amongst things). can also employ ggdist-specific color_ramp fill_ramp aesthetics create custom gradients outline fill colors, demonstrated later section. Note: examples gradients section use (optional) experimental setting fill_type = \"gradient\". R greater 4.1.0 using supported graphics device, output may blank; case, omit option. Gradients can produced without option may look nice.","code":""},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"ccdf-gradients","dir":"Articles","previous_headings":"Custom plots","what":"CCDF Gradients","title":"Slab + interval stats and geoms","text":"default, stat_ccdfinterval() maps output evaluated function (case, CCDF) onto thickness aesthetic slabinterval geom, determines thick slab . equivalent setting aes(thickness = after_stat(f)). However, instead create CCDF gradient plot, sort mashup CCDF barplot density gradient plot, mapping after_stat(f) onto slab_alpha aesthetic instead, setting thickness constant (1):  approach applied bins histogram, bin uncertainty associated height, result -called fuzzygram (Haber Wilkinson 1982).","code":"df %>%   ggplot(aes(x = group, y = value, fill = subgroup)) +   stat_ccdfinterval(aes(slab_alpha = after_stat(f)),     thickness = 1, position = \"dodge\", fill_type = \"gradient\"   ) +   expand_limits(y = 0) +   # plus coord_cartesian so there is no space between bars and axis   coord_cartesian(expand = FALSE) +   ggtitle(\"stat_ccdfinterval(thickness = 1)\", \"aes(slab_alpha = after_stat(f))\")"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"highlighting-and-other-combinations","dir":"Articles","previous_headings":"Custom plots","what":"Highlighting and other combinations","title":"Slab + interval stats and geoms","text":"ability map arbitrary variables onto fill outline colors within slab allows easily highlight sub-regions plot. Taking earlier example visualizing priors, can add mapping fill aesthetic highlight region interest, say ±1.5:  also combine aesthetics arbitrarily. (probably useful) eye plot + gradient plot combination, portion distribution 1 highlighted:","code":"priors = tibble(   dist = c(dist_normal(0, 1), dist_student_t(3, 0, 1)) )  priors %>%   ggplot(aes(y = format(dist), xdist = dist)) +   stat_halfeye(aes(fill = after_stat(abs(x) < 1.5))) +   ggtitle(\"stat_halfeye()\", \"aes(fill = after_stat(abs(x) < 1.5)))\") +   # we'll use a nicer palette than the default for highlighting:   scale_fill_manual(values = c(\"gray85\", \"skyblue\")) priors %>%   ggplot(aes(y = format(dist), xdist = dist)) +   stat_eye(aes(slab_alpha = after_stat(f), fill = after_stat(x > 1)), fill_type = \"gradient\") +   ggtitle(     \"stat_eye(fill_type = 'gradient')\",     \"aes(slab_alpha = after_stat(f), fill = after_stat(x > 1)))\"   ) +   # we'll use a nicer palette than the default for highlighting:   scale_fill_manual(values = c(\"gray75\", \"skyblue\"))"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"mashups-with-correll-and-gleicher-style-gradients","dir":"Articles","previous_headings":"Custom plots","what":"Mashups with Correll and Gleicher-style gradients","title":"Slab + interval stats and geoms","text":"can also take advantage fact slabinterval stats also supply cdf pdf aesthetics create charts make use CDF PDF aesthetic mappings. example, create Correll & Gleicher-style gradient plots fading tails outside 95% interval proportion \\(|1 - 2F(x)|\\) (\\(F(x)\\) CDF):  also mashup faded-tail gradients violin plots starting eye plot using generated cdf aesthetic fade tails, producing plots like Helske et al.:  related idea one Tukey: rather visually emphasizing value likely, emphasize unlikely. Tukey used visual representation showing pointwise simultaneous intervals, example something bit different, inverting faded-tails function Correll & Gleicher create bars “block ” regions low likelihood:  Thanks Jessica Hullman suggesting Tukey paper inspired idea.","code":"priors %>%   ggplot(aes(y = format(dist), xdist = dist)) +   stat_gradientinterval(aes(slab_alpha = after_stat(-pmax(abs(1 - 2*cdf), .95))),     fill_type = \"gradient\"   ) +   scale_slab_alpha_continuous(guide = \"none\") +   ggtitle(     \"stat_gradientinterval(fill_type = 'gradient')\",     \"aes(slab_alpha = after_stat(-pmax(abs(1 - 2*cdf), .95)))\"   ) priors %>%   ggplot(aes(y = format(dist), xdist = dist)) +   stat_eye(aes(slab_alpha = after_stat(-pmax(abs(1 - 2*cdf), .95))), fill_type = \"gradient\") +   scale_slab_alpha_continuous(guide = \"none\") +   ggtitle(     \"stat_eye(fill_type = 'gradient')\",     \"aes(slab_alpha = after_stat(-pmax(abs(1 - 2*cdf), .95)))\"   ) dist_df %>%   ggplot(aes(x = group, ydist = dist_normal(mean, sd), fill = subgroup)) +   stat_slab(     aes(       thickness = after_stat(pmax(0, abs(1 - 2*cdf) - .95)),       fill_ramp = after_stat(pmax(0, abs(1 - 2*cdf) - .95))     ),     side = \"both\", position = \"dodge\", fill_type = \"gradient\"   ) +   labs(     title = 'stat_slab(side = \"both\")',     subtitle = paste0(       \"aes(fill = subgroup,\\n       \",       \"fill_ramp and thickness = after_stat(pmax(0, abs(1 - 2*cdf) - .95)))\"     )   ) +   guides(fill_ramp = \"none\") +   coord_cartesian(expand = FALSE)"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"densities-filled-according-to-intervals","dir":"Articles","previous_headings":"Custom plots","what":"Densities filled according to intervals","title":"Slab + interval stats and geoms","text":"Another common chart type involves filling interior halfeye plot according intervals. , can use fact computed variables interval sub-geometry made available slab sub-geometry vice versa. example, within slab sub-geometry, .width level computed variables correspond smallest intervals contain x value portion slab. Thus, can map .width level onto slab fill:  (Note: previous versions ggdist, using cut_cdf_qi() recommended way achieve affect. function still exists backwards compatibility, mapping level .width now recommended approach, generalizes interval types, highest-density intervals — see later.) apply color scale values outside intervals, one option split stat_halfeye() constituent parts (stat_slab() stat_pointinterval()), include “100%” interval .width:  change interval type used, resulting .width level computed variables change correspondingly, allowing us highlight types intervals besides quantile intervals; example, highest-density intervals:","code":"df %>%   ggplot(aes(y = group, x = value)) +   stat_halfeye(aes(fill = after_stat(level))) +   # na.translate = FALSE drops the unnecessary NA from the legend, which covers   # slab values outside the intervals. An alternative would be to use   # na.value = ... to set the color for values outside the intervals.   scale_fill_brewer(na.translate = FALSE) +   labs(     title = \"stat_halfeye()\",     subtitle = \"aes(fill = after_stat(level))\",     fill = \"interval\"   ) df %>%   ggplot(aes(y = group, x = value)) +   stat_slab(aes(fill = after_stat(level)), .width = c(.66, .95, 1)) +   stat_pointinterval() +   scale_fill_brewer() +   labs(     title = \"stat_slab()\",     subtitle = \"aes(fill = after_stat(level), .width = c(.66, .95, 1))\",     fill = \"interval\"   ) qi_plot = data.frame(dist = dist_beta(10, 2)) %>%   ggplot(aes(xdist = dist)) +   stat_halfeye(aes(fill = after_stat(level)), point_interval = median_qi, .width = c(.5, .8, .95)) +   scale_fill_brewer(na.value = \"gray95\") +   labs(subtitle = \"stat_halfeye(aes(fill = after_stat(level)), point_interval = median_qi)\")  hdi_plot = data.frame(dist = dist_beta(10, 2)) %>%   ggplot(aes(xdist = dist)) +   stat_halfeye(aes(fill = after_stat(level)), point_interval = mode_hdci, .width = c(.5, .8, .95)) +   scale_fill_brewer(na.value = \"gray95\") +   labs(subtitle = \"stat_halfeye(aes(fill = after_stat(level)), point_interval = mode_hdci)\")  qi_plot /   hdi_plot"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"annotating-slabs-with-spikes","dir":"Articles","previous_headings":"Custom plots","what":"Annotating slabs with spikes","title":"Slab + interval stats and geoms","text":"geom_spike() stat_spike() make straightforward apply custom “spike” annotations slabs. easiest way use spikes use stat_spike() pass numeric position function giving numeric position(s) wish place spike (list ). passed function, function applied distributional posterior::rvar() object used internally represent distribution. means point estimates (e.g., mean(), median(), Mode()), quantiles (quantile()), interval estimates (qi(), hdci(), hdi()) can provided stat_spike() directly. makes easy modify previous example highlight medians quantile intervals differ modes highest-density intervals terms densities:  Note use scale_thickness_shared(), ensures thickness values slabs thickness values spikes (determine heights) use shared scale, line correctly.","code":"qi_plot_spikes = data.frame(dist = dist_beta(10, 2)) %>%   ggplot(aes(xdist = dist)) +   stat_slab(aes(fill = after_stat(level)), point_interval = median_qi, .width = c(.5, .95)) +   # stat_spike(at = c(median, qi)) would also work, but this demonstrates how   # to re-label the names of the `at` computed variable and use it in an   # aesthetic mapping by mapping it to `linetype`   stat_spike(aes(linetype = after_stat(at)), at = c(\"median\", \"interval (qi)\" = qi)) +   scale_fill_brewer(na.value = \"gray95\") +   scale_thickness_shared() +   labs(subtitle = \"stat_slab() + stat_spike(at = c(median, qi))\")  hdi_plot_spikes = data.frame(dist = dist_beta(10, 2)) %>%   ggplot(aes(xdist = dist)) +   stat_slab(aes(fill = after_stat(level)), point_interval = mode_hdi, .width = c(.5, .95)) +   stat_spike(aes(linetype = after_stat(at)), at = c(\"mode\" = Mode, \"interval (hdi)\" = hdi)) +   scale_fill_brewer(na.value = \"gray95\") +   scale_thickness_shared() +   labs(subtitle = \"stat_slab() + stat_spike(at = c(Mode, hdi))\")  qi_plot_spikes /   hdi_plot_spikes"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"using-color-ramps-for-fill-and-color-aesthetics","dir":"Articles","previous_headings":"Custom plots","what":"Using color ramps for fill and color aesthetics","title":"Slab + interval stats and geoms","text":"ggdist supplies color_ramp (colour_ramp) fill_ramp aesthetics can used vary (“ramp”) outline fill colors smoothly base color (default \"white\") whatever color geometry otherwise . Taking example interval-filled slabs, use fill_ramp aesthetic instead fill aesthetic set slab color based interval . vary base fill color separately interval based another column original data table, subgroup column:  similarly use stat_interval() color_ramp aesthetic vary subgroup color separately whiteness intervals. , level variable generated stats stat_slabinterval() family contains level generated intervals, ordered factor.  See help(\"scale_color_ramp\") information color ramp aesthetics/scales.","code":"df %>%   ggplot(aes(y = group, x = value)) +   stat_halfeye(     aes(fill = subgroup, fill_ramp = after_stat(level)),     .width = c(.50, .80, .95),     # NOTE: we use position = \"dodgejust\" (a dodge that respects the     # justification of intervals relative to slabs) instead of     # position = \"dodge\" here because it ensures the topmost slab does     # not extend beyond the plot limits     position = \"dodgejust\"   ) +   # a range from 1 down to 0.2 ensures the fill goes dark to light inside-out   # and doesn't get all the way down to white (0) on the lightest color   scale_fill_ramp_discrete(na.translate = FALSE) +   labs(     title = \"stat_halfeye(position = 'dodgejust')\",     subtitle = \"aes(fill = subgroup, fill_ramp = after_stat(level))\",     fill_ramp = \"interval\"   ) dist_df %>%   ggplot(aes(x = group, ydist = dist_normal(mean, sd), color = subgroup)) +   stat_interval(aes(color_ramp = after_stat(level)), position = \"dodge\") +   labs(     title = \"stat_interval()\",     subtitle = \"aes(color = subgroup, color_ramp = after_stat(level))\"   )"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"raindrop-plots","dir":"Articles","previous_headings":"Custom plots","what":"Raindrop plots","title":"Slab + interval stats and geoms","text":"Barrowman Myers proposed alternative density-based eye plots (created stat_eye() default) called raindrop plots. , thickness slab proportional log(pdf) instead pdf, bounded within 95% interval. can construct function uses pdf .width computed variables give thickness proportional log(pdf) within 95% interval, use create raindrop plots. Barrowman Myers apply technique 95% raindrop superimposed 99% raindrop, can replicate:","code":"priors %>%   ggplot(aes(y = format(dist), xdist = dist)) +   # must also use normalize = \"groups\" because min(log(pdf)) will be different for each dist   stat_slab(     aes(thickness = after_stat(ifelse(.width <= 0.99, log(pdf), NA))),     normalize = \"groups\", fill = \"gray85\", .width = .99, side = \"both\"   ) +   stat_eye(     aes(thickness = after_stat(ifelse(.width <= 0.95, log(pdf), NA))),     normalize = \"groups\"   ) +   ggtitle(     'stat_eye(normalize = \"groups\")',     paste0(       \"with aes(thickness = after_stat(ifelse(.width <= 0.95, log(pdf), NA)))\\n\",       \"and aes(thickness = after_stat(ifelse(.width <= 0.99, log(pdf), NA)))\"     )   )"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"creating-ridge-plots","dir":"Articles","previous_headings":"Custom plots","what":"Creating ridge plots","title":"Slab + interval stats and geoms","text":"plotting densities (stat_halfeye(), stat_slab(), etc) can useful overplot many densities simultaneously, approach sometimes called ridge plots (e.g. ggridges package). can done setting scale height value greater 1. Setting height often best approach correctly adjust plot boundaries (unless need use position = \"dodge\", case use scale adjust plot boundaries manually).  Depending makes sense data (example, scale unbounded), may also wish adjust density trim parameters. default density, density_bounded(), estimates bounds distribution, useful data natural boundaries (e.g., restricted positive). know underlying distribution unbounded, can set density = \"unbounded\". may also want set trim FALSE ensure densities smoothly go 0, rather cut limits raw data. Combining expand = TRUE make slab expand limits x axis. ’ll use density, trim, expand along combination fill fill_ramp give group y axis different color vary fill along x axis way provides “softer” form region practical equivalence:  use tighter ramp color compared fill (via -dnorm() instead abs()) want outlines quickly ramp back black outside 0 sufficient contrast slabs overlap.","code":"set.seed(1234)  ridges_df = data.frame(   group = letters[7:1],   x = rnorm(700, mean = 1:7, sd = 2) )  ridges_df %>%   ggplot(aes(y = group, x = x)) +   stat_slab(height = 2, color = \"black\") +   ggtitle(\"stat_slab(height = 2, color = 'black')\") ridges_df %>%   ggplot(aes(     y = group, x = x,     fill = group, fill_ramp = after_stat(abs(x)),     color_ramp = after_stat(-dnorm(x, 0, 2))   )) +   stat_slab(     height = 2, color = \"gray15\",     expand = TRUE, trim = FALSE, density = \"unbounded\",     fill_type = \"gradient\",     show.legend = FALSE   ) +   geom_vline(xintercept = 0, color = \"gray85\", linetype = \"dashed\") +   ggtitle(     'stat_slab(height = 2, color = \"black\", expand = TRUE, trim = FALSE)',     'aes(fill = group, fill_ramp = after_stat(abs(x)), color_ramp = after_stat(-dnorm(x, 0, 2)))'   ) +   scale_fill_viridis_d()"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"varying-side-scale-and-justification-within-geoms","dir":"Articles","previous_headings":"Custom plots","what":"Varying side, scale, and justification within geoms","title":"Slab + interval stats and geoms","text":"side, scale, justification parameters can also varied within geoms geom_slabinterval() family, allowing (example) different groups hang interval:","code":"dist_df %>%   filter(subgroup == \"h\") %>%   mutate(side = c(\"top\", \"both\", \"bottom\")) %>%   ggplot(aes(y = group, xdist = dist_normal(mean, sd), side = side)) +   stat_dotsinterval(scale = 2/3) +   labs(     title = 'stat_dotsinterval(scale = 2/3)',     subtitle = 'aes(xdist = dist_normal(mean, sd), side = c(\"top\",\"both\",\"bottom\"))'   ) +   coord_cartesian()"},{"path":"http://mjskay.github.io/ggdist/articles/slabinterval.html","id":"multiple-slabs-and-intervals-in-composite-plots","dir":"Articles","previous_headings":"Custom plots","what":"Multiple slabs and intervals in composite plots","title":"Slab + interval stats and geoms","text":"Sometimes may want include multiple different types slabs plot order take advantage features slab type provides. example, people often combine densities dotplots show underlying datapoints go density estimate, creating -called “rain cloud” plots. use multiple slab geometries together, can use side parameter change side interval slab drawn set scale parameter something around 0.5 (default 0.9) two slabs overlap. Geoms can also dodged together, example using densities quantile dotplots subgroups. example also shows stat_pointinterval() can repurposed used geoms; replace points labels (idea replacing points labels comes Brenton Wiernik).  constructing composite plots may useful position slab interval parts geometry separately. relative positioning geometries supported manipulating justification parameter, want complete, separate control positioning intervals versus slabs, simplest approach can specify geometries separately. example, following uses separate specification stat_slab() stat_pointinterval() instead combined stat_slabinterval() order use position_dodge() intervals slabs:  (Thanks Brenton Wiernik example.)","code":"df %>%   ggplot(aes(x = group, y = value, fill = subgroup)) +   stat_slab(side = \"left\", scale = 0.5, position = \"dodge\") +   stat_dotsinterval(scale = 0.5, quantiles = 100, position = \"dodge\") +   stat_pointinterval(     geom = \"label\",     aes(label = paste0(group, subgroup)),     .width = .5,  # set to a scalar to draw only one label instead of two     position = position_dodge(width = 1),     size = 3.5   ) +   labs(title = paste0(     'stat_halfeye(side = \"left\") +\\n',     'stat_dotsinterval(quantiles = 100) +\\n',     'stat_pointinterval(geom = \"label\")'   )) df %>%   ggplot(aes(fill = group, color = group, x = value)) +   stat_slab(alpha = .3) +   stat_pointinterval(position = position_dodge(width = .4, preserve = \"single\")) +   labs(     title = \"stat_slab() and stat_pointinterval()\",     subtitle = \"with position_dodge() applied to the intervals\",     y = NULL   ) +   scale_y_continuous(breaks = NULL)"},{"path":"http://mjskay.github.io/ggdist/articles/thickness.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Thickness scale","text":"vignette describes thickness scale / aesthetic used slab+interval family geoms stats ggdist (see vignette(\"slabinterval\") family).","code":""},{"path":"http://mjskay.github.io/ggdist/articles/thickness.html","id":"setup","dir":"Articles","previous_headings":"","what":"Setup","title":"Thickness scale","text":"following libraries required run vignette:","code":"library(ggplot2) library(dplyr) library(distributional) library(ggdist)  theme_set(theme_ggdist())"},{"path":"http://mjskay.github.io/ggdist/articles/thickness.html","id":"the-thickness-scale","dir":"Articles","previous_headings":"","what":"The thickness scale","title":"Thickness scale","text":"thickness scale positional subscale used geom_slabinterval() construct slabs, ribbon-like geometries fixed baseline height determined thickness aesthetic. thickness scale typically used via stat_slabinterval() derivative stats, allow map distribution functions (like densities CDFs) onto thickness aesthetic. thickness exists scale separate typical x y aesthetics (even width/height, xmin/xmax, ymin/ymax) easy plot multiple slabs plot, separate thickness subscale. example:  plot, values assigned thickness aesthetic scaled onto common scale, slabs positioned baselines y value specified slab.","code":"df = tibble(   h = c(0,1,1,0, 0,2,2,0, 0,4/3,4/3,0,  0,1,1,0,     0,1.25,1.25,0, 0,.5,.5,0),   x = c(0,1,4,5, 4,5,6,7, 6,7,9,10,     11,12,15,16, 1,2,4.2,5.2,   4,5,12,13),   y     = rep(c(\"a\", \"b\", \"a\", \"a\", \"b\", \"a\"), each = 4),   group = rep(c(\"c\", \"c\", \"d\", \"d\", \"c\", \"c\"), each = 4),   panel = rep(c(\"e\", \"e\", \"e\", \"e\", \"f\", \"f\"), each = 4),   name  = rep(c(1,    2, \"3a\",\"3b\",  4,   5),  each = 4) )  df_group = df %>%   summarise(x = mean(x), .by = c(name, group, panel, y))  df %>%   ggplot(aes(x = x, y = y, fill = group, thickness = h)) +   geom_slab(color = \"gray25\", alpha = 0.75) +   scale_y_discrete(expand = expansion(add = 0.1)) +   scale_fill_brewer(palette = \"Set2\") +   facet_grid(cols = vars(panel), labeller = \"label_both\") +   labs(\"geom_slab() with default thickness scaling\") +   theme(     legend.position = \"bottom\",     panel.grid.major.y = element_line(color = \"gray85\"),     panel.background = element_rect(color = \"gray70\", fill = NA)   )"},{"path":"http://mjskay.github.io/ggdist/articles/thickness.html","id":"adjusting-normalization-within-one-geometry","dir":"Articles","previous_headings":"","what":"Adjusting normalization within one geometry","title":"Thickness scale","text":"default thickness scaling shown corresponds normalize = \"\" option geom_slab(). uses scale slabs, scaling according maximum height tallest slab. normalize parameter provides set options define hierarchy increasingly specific sets within scale slabs: \"\" scales according maximum slabs; \"panels\" scales according maximum within panel (facet); \"xy\" scales according maximum within x/y position within panel; \"groups\" scales according maximum within group within x/y position within panel. x/y position referred unique x y position slab -axis. example, unique y positions chart (\"\" \"b\"), chart drawn horizontal orientation.","code":""},{"path":"http://mjskay.github.io/ggdist/articles/thickness.html","id":"normalize-all","dir":"Articles","previous_headings":"Adjusting normalization within one geometry","what":"normalize = \"all\"","title":"Thickness scale","text":"can see normalization affects scales annotating previous plot default normalization settings:  Notice minimum maximum value thickness subscale : maximum thickness value slabs; .e. height tallest slab data. conservative default setting ensures slabs geometry scaled together.","code":"subguide_orangered = subguide_outside(   title = \"thickness\",   position = \"right\",   theme = theme_ggdist() + theme(     text = element_text(color = \"orangered\"),     axis.line.y = element_line(color = \"orangered\"),     axis.ticks.y = element_line(color = \"orangered\"),     axis.text.y = element_text(color = \"orangered\")   ) )  plot_slabs_with_scales = function(..., subguide = subguide_orangered) {   df %>%     ggplot(aes(x = x, y = y, fill = group)) +     geom_hline(yintercept = c(1,1.9, 2,2.9), color = \"orangered\", linetype = \"11\", linewidth = 0.5) +     geom_slab(       aes(thickness = h),       subguide = subguide,       alpha = 0.75,       color = \"gray25\",       ...     ) +     geom_label(       aes(label = name),       data = df_group,       color = \"gray25\",       alpha = 0.75,       vjust = 0,       show.legend = FALSE     ) +     scale_y_discrete(expand = expansion(add = 0.1)) +     scale_fill_brewer(palette = \"Set2\") +     facet_grid(cols = vars(panel), labeller = \"label_both\") +     theme(       plot.margin = margin(5.5, 50, 5.5, 5.5),       panel.spacing.x = unit(40, \"pt\"),       legend.position = \"bottom\",       panel.background = element_rect(color = \"gray70\", fill = NA)     ) }  plot_slabs_with_scales(normalize = \"all\") +   labs(     title = \"geom_slab(normalize = 'all')\",     subtitle = \"default normalization settings\"   )"},{"path":"http://mjskay.github.io/ggdist/articles/thickness.html","id":"normalize-panels","dir":"Articles","previous_headings":"Adjusting normalization within one geometry","what":"normalize = \"panels\"","title":"Thickness scale","text":"Sometimes may separate panels within want scale slabs together. can using normalize = \"panels\":  Notice thickness scales inside given panel : panel \"e\" maximum thickness 2 (height slab 2) panel \"f\" maximum thickness 1.25 (height slab 4). slabs within panel scaled accordingly.","code":"plot_slabs_with_scales(normalize = \"panels\") +   labs(     title = \"geom_slab(normalize = 'panels')\",     subtitle = \"scales to the maximum height within each panel\"   )"},{"path":"http://mjskay.github.io/ggdist/articles/thickness.html","id":"normalize-xy","dir":"Articles","previous_headings":"Adjusting normalization within one geometry","what":"normalize = \"xy\"","title":"Thickness scale","text":"Often useful scale slabs x y position together, whether scale within x y determined orientation geometry. can using normalize = \"xy\":  plot, orientation = \"horizontal\", normalize = \"xy\" scales within unique y position; .e. values \"\" \"b\". Normalization settings hierarchical, uses maximum thickness value within y position within panel. Thus: slab 2 scaled maximum 2.0; slabs 1, 3a, 3b scaled maximum 1.33 (height slab 3a); slab 4 scaled maximum 1.25; slab 5 scaled maximum 0.5.","code":"plot_slabs_with_scales(normalize = \"xy\") +   labs(     title = \"geom_slab(normalize = 'xy')\",     subtitle = \"scales to the maximum height within each x/y position within each panel\"   )"},{"path":"http://mjskay.github.io/ggdist/articles/thickness.html","id":"normalize-groups","dir":"Articles","previous_headings":"Adjusting normalization within one geometry","what":"normalize = \"groups\"","title":"Thickness scale","text":"Finally, can useful scale slabs according maximum height. can using normalize = \"groups\". Notably, multiple groups x/y position, combine normalize = \"groups\" thickness subguide except \"none\", thickness subguides y value unique. Hence error: Thus example omit thickness subguide:  Notice groups scaled maximum height maximum thickness value; thus, slab 1 slab 3b longer height. slab 3b scaled touch maximum thickness? geom_slab() technically considers values different groups different slabs, slab 3a 3b actually parts slab, indicated unbroken outline drawn .","code":"plot_slabs_with_scales(normalize = \"groups\") ## Error in `geom_slab()`: ## ! Problem while converting geom to grob. ## ℹ Error occurred in the 2nd layer. ## Caused by error in `fun()`: ## ! Cannot draw a subguide for the thickness axis when multiple slabs with different ##   normalizations are drawn on the same axis. plot_slabs_with_scales(normalize = \"groups\", subguide = \"none\") +   labs(     title = \"geom_slab(normalize = 'groups')\",     subtitle = \"scales to the maximum height within each group within each x/y position within each panel\"   )"},{"path":"http://mjskay.github.io/ggdist/articles/thickness.html","id":"sharing-thickness-scales-across-multiple-geometries","dir":"Articles","previous_headings":"","what":"Sharing thickness scales across multiple geometries","title":"Thickness scale","text":"Sometimes want use different geometries plot slabs scale. often happens plotting priors posteriors, may happen cases well. prior posterior plotted using separate geometries, thickness scales annotated:  Notice two geometries different thickness scales. add scale_thickness_shared() plot, given scale:  scaled_thickness_shared() works scaling values tagging special thickness() datatype. type carries information original scale limits (used draw subguides), also tells slab geometries normalization. Thus, use scale_thickness_shared(), normalize parameter slab geometry ignored.","code":"df_prior_post = data.frame(   prior = dist_normal(0, 1),   posterior = dist_normal(0.1, 0.3) )  prior_post_plot = df_prior_post %>%   ggplot() +   stat_slab(     aes(xdist = posterior),     subguide = subguide_inside(title = \"posterior thickness\")   ) +   stat_slab(     aes(xdist = prior),     color = \"orangered\",     fill = NA,     subguide = subguide_orangered(title = \"prior thickness\", just = 0, label_side = \"inside\")   ) +   scale_y_continuous(breaks = NULL) +   theme(panel.background = element_rect(color = \"gray70\", fill = NA))  prior_post_plot +   labs(     title = \"two different slab geometries\",     subtitle = \"thickness scales are not shared across geometries by default\"   ) prior_post_plot +   scale_thickness_shared() +   labs(     title = \"two different slab geometries\",     subtitle = \"using scale_thickness_shared() to share thickness scale across geometries\"   )"},{"path":"http://mjskay.github.io/ggdist/articles/thickness.html","id":"spacing-slabs-with-height-and-scale","dir":"Articles","previous_headings":"","what":"Spacing slabs with height and scale","title":"Thickness scale","text":"thickness aesthetic drawn within subset bounding box geom_slab() determined scale aesthetic, defaults 0.9:  allows us adjust spacing slabs using scale:","code":"cap = arrow(angle = 90, length = unit(5, \"pt\"), ends = \"both\")  scale_plot = function(scale = 0.9) {   tibble(d = dist_normal(c(4,5)), y = c(\"a\",\"b\")) %>%     ggplot(aes(xdist = d, y = y)) +     geom_hline(       yintercept = c(1, 1 + scale, 2, 2 + scale),       color = \"orangered\", linetype = \"11\", linewidth = 0.5     ) +     stat_slab(scale = scale, subguide = subguide_orangered) +     annotate(\"segment\", x = c(-5,-4), xend = c(-5,-4), y = c(1,2), yend = c(2,3),       arrow = cap, linewidth = 0.75, color = \"gray25\"     ) +     annotate(\"label\", x = c(-5,-4), y = c(1.5, 2.5),       label = \"height = 1\", hjust = -0.05, color = \"gray25\"     ) +     annotate(\"segment\", x = c(-2,-1), xend = c(-2,-1), y = c(1,2), yend = c(1,2) + scale,       arrow = cap, linewidth = 0.75, color = \"gray25\"     ) +     annotate(\"label\", x = c(-2,-1), y = c(1,2) + scale/2,       label = paste(\"scale =\", scale), hjust = -0.05, color = \"gray25\"     ) +     scale_y_discrete(expand = expansion(add = 0)) +     scale_x_continuous(limits = c(-5, 10)) +     theme(       plot.margin = margin(5.5, 40, 5.5, 5.5),       panel.background = element_rect(color = \"gray70\")     ) +     coord_cartesian(clip = \"off\") }  scale_plot(scale = 0.9) +   labs(     title = \"geom_slab()\",     subtitle = \"using default height = 1 and scale = 0.9\"   ) scale_plot(scale = 0.65) +   labs(     title = \"geom_slab()\",     subtitle = \"using scale = 0.65 to increase spacing between slabs\"   )"},{"path":"http://mjskay.github.io/ggdist/articles/thickness.html","id":"spacing-dodged-slabs","dir":"Articles","previous_headings":"Spacing slabs with height and scale","what":"Spacing dodged slabs","title":"Thickness scale","text":"height scale particularly useful combined dodging, modifying height allows change spacing sets slabs y value, modifying scale allows change spacing within sets:  decrease height, increases space sets slabs y value:  decrease scale, increases spacing within sets slabs y value:","code":"dodged_scale_plot = function(height = 1, scale = 0.9, add = 0) {   baselines = c(1 - height/2, 1, 2 - height/2, 2)   tibble(     d = dist_normal(c(4,5,4,5)),     y = c(\"a\",\"a\",\"b\",\"b\"),     group = c(\"d\",\"e\",\"d\",\"e\")   ) %>%     ggplot(aes(xdist = d, y = y, fill = group)) +     geom_hline(yintercept = c(1,2) + height/2, color = \"gray85\") +     geom_hline(       yintercept = c(baselines, baselines + height/2*scale),       color = \"orangered\",       linetype = \"11\",       linewidth = 0.5     ) +     stat_slab(       height = height, scale = scale,       subguide = subguide_orangered, position = \"dodgejust\",       alpha = 0.75     ) +     annotate(\"segment\",       x = c(-5,-4), xend = c(-5,-4),       y = c(1,2) - height/2, yend = c(1,2) + height/2,       arrow = cap, color = \"gray25\", linewidth = 0.75     ) +     annotate(\"label\", x = c(-5,-4), y = c(1, 2),       label = paste(\"height =\", height), hjust = -0.05,       color = \"gray25\"     ) +     annotate(\"segment\", x = c(-2,-2,-1,-1), xend = c(-2,-2,-1,-1),       y = baselines, yend = baselines + scale * height/2,       arrow = cap, color = \"gray25\", linewidth = 0.75     ) +     annotate(\"label\", x = c(-2,-2,-1,-1),       y = baselines + scale*height/4, label = paste(\"scale =\", scale),       hjust = -0.05, color = \"gray25\"     ) +     scale_y_discrete(expand = expansion(add = add)) +     scale_x_continuous(limits = c(-5, 10)) +     scale_fill_brewer(palette = \"Set2\") +     theme(       plot.margin = margin(5.5, 40, 5.5, 5.5),       panel.background = element_rect(color = \"gray70\"),       legend.position = \"bottom\"     ) +     coord_cartesian(clip = \"off\") }  dodged_scale_plot(height = 1, scale = 0.9, add = 0) +   labs(     title = 'geom_slab(position = \"dodgejust\")',     subtitle = \"using default height = 1 and scale = 0.9\"   ) dodged_scale_plot(height = 0.8, scale = 0.9, add = 0.6) +   labs(     title = 'geom_slab(position = \"dodgejust\")',     subtitle = \"using height = 0.8 to increase the space between sets\"   ) dodged_scale_plot(height = 0.8, scale = 0.65, add = 0.6) +   labs(     title = 'geom_slab(position = \"dodgejust\")',     subtitle = \"using height = 0.8 and scale = 0.65\"   )"},{"path":"http://mjskay.github.io/ggdist/articles/thickness.html","id":"ridgeline-plots-with-height-1","dir":"Articles","previous_headings":"Spacing slabs with height and scale","what":"Ridgeline plots with height > 1","title":"Thickness scale","text":"Finally, height can also greater 1, can used create overlapping slabs, -called ridgeline plots:","code":"data.frame(   d = dist_normal(10:1/4, 1 + 10:1/15),   y = letters[1:10] ) %>%   ggplot(aes(xdist = d, y = y)) +   stat_slab(height = 3, color = \"gray25\") +   labs(     title = \"geom_slab()\",     subtitle = \"using height > 1 to create ridgeline plots\"   )"},{"path":"http://mjskay.github.io/ggdist/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Matthew Kay. Author, maintainer. Brenton M. Wiernik. Contributor.","code":""},{"path":"http://mjskay.github.io/ggdist/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Kay M (2024). “ggdist: Visualizations Distributions Uncertainty Grammar Graphics.” IEEE Transactions Visualization Computer Graphics, 30(1), 414–424. doi:10.1109/TVCG.2023.3327195. Kay M (2024). ggdist: Visualizations Distributions Uncertainty. doi:10.5281/zenodo.3879620, R package version 3.3.2, https://mjskay.github.io/ggdist/.","code":"@Article{,   author = {Matthew Kay},   title = {{ggdist}: Visualizations of Distributions and Uncertainty in the Grammar of Graphics},   journal = {IEEE Transactions on Visualization and Computer Graphics},   year = {2024},   volume = {30},   number = {1},   pages = {414--424},   doi = {10.1109/TVCG.2023.3327195}, } @Manual{,   title = {{ggdist}: Visualizations of Distributions and Uncertainty},   author = {Matthew Kay},   year = {2024},   note = {R package version 3.3.2},   url = {https://mjskay.github.io/ggdist/},   doi = {10.5281/zenodo.3879620}, }"},{"path":"http://mjskay.github.io/ggdist/index.html","id":"ggdist-visualizations-of-distributions-and-uncertainty","dir":"","previous_headings":"","what":"Visualizations of Distributions and Uncertainty","title":"Visualizations of Distributions and Uncertainty","text":"ggdist R package provides flexible set ggplot2 geoms stats designed especially visualizing distributions uncertainty. designed frequentist Bayesian uncertainty visualization, taking view uncertainty visualization can unified perspective distribution visualization: frequentist models, one visualizes confidence distributions bootstrap distributions (see vignette(\"freq-uncertainty-vis\")); Bayesian models, one visualizes probability distributions (see tidybayes package, builds top ggdist). geom_slabinterval() / stat_slabinterval() family (see vignette(\"slabinterval\")) makes easy visualize point summaries intervals, eye plots, half-eye plots, ridge plots, CCDF bar plots, gradient plots, histograms, : geom_dotsinterval() / stat_dotsinterval() family (see vignette(\"dotsinterval\")) makes easy visualize dot+interval plots, Wilkinson dotplots, beeswarm plots, quantile dotplots (combined half-eyes, composite plots like rain cloud plots):  geom_lineribbon() / stat_lineribbon() family (see vignette(\"lineribbon\")) makes easy visualize fit lines arbitrary number uncertainty bands:  stat ggdist also support visualizing analytical distributions vectorized distribution data types like distributional objects posterior::rvar() objects. particularly useful visualizing uncertainty frequentist models (see vignette(\"freq-uncertainty-vis\")) visualizing priors Bayesian analysis. ggdist geoms stats also form core part tidybayes package (fact, originally part tidybayes). examples use ggdist geoms stats visualizing uncertainty Bayesian models, see vignettes tidybayes, vignette(\"tidybayes\", package = \"tidybayes\") vignette(\"tidy-brms\", package = \"tidybayes\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Visualizations of Distributions and Uncertainty","text":"can install currently-released version CRAN R command: Alternatively, can install latest development version GitHub R commands:","code":"install.packages(\"ggdist\") install.packages(\"devtools\") devtools::install_github(\"mjskay/ggdist\")"},{"path":"http://mjskay.github.io/ggdist/index.html","id":"feedback-issues-and-contributions","dir":"","previous_headings":"","what":"Feedback, issues, and contributions","title":"Visualizations of Distributions and Uncertainty","text":"welcome feedback, suggestions, issues, contributions! particularly reliable email, though can contact mjskay@northwestern.edu. Twitter reliable. found bug, please file minimal code reproduce issue. Pull requests filed dev branch.","code":""},{"path":"http://mjskay.github.io/ggdist/index.html","id":"citing-ggdist","dir":"","previous_headings":"","what":"Citing ggdist","title":"Visualizations of Distributions and Uncertainty","text":"Matthew Kay (2024). ggdist: Visualizations Distributions Uncertainty Grammar Graphics. IEEE Transactions Visualization Computer Graphics, 30(1), 414–424. DOI: 10.1109/TVCG.2023.3327195. Matthew Kay (2024). ggdist: Visualizations Distributions Uncertainty. R package version 3.3.2, https://mjskay.github.io/ggdist/. DOI: 10.5281/zenodo.3879620.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/align.html","id":null,"dir":"Reference","previous_headings":"","what":"Break (bin) alignment methods — align","title":"Break (bin) alignment methods — align","text":"Methods aligning breaks (bins) histograms, used align argument density_histogram(). Supports automatic partial function application.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/align.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Break (bin) alignment methods — align","text":"","code":"align_none(breaks)  align_boundary(breaks, at = 0)  align_center(breaks, at = 0)"},{"path":"http://mjskay.github.io/ggdist/reference/align.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Break (bin) alignment methods — align","text":"breaks sorted vector breaks (bin edges). scalar numeric giving alignment point. align_boundary(): align breaks bin edge lines . align_center(): align breaks center bin lines .","code":""},{"path":"http://mjskay.github.io/ggdist/reference/align.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Break (bin) alignment methods — align","text":"scalar numeric returning offset subtracted breaks.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/align.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Break (bin) alignment methods — align","text":"functions take sorted vector equally-spaced breaks giving bin edges return numeric offset , subtracted breaks, align desired: align_none() performs alignment (always returns 0). align_boundary() ensures bin edge lines . align_center() ensures bin center lines . align_boundary() (respectively align_center()), bin edge (center) range breaks line , ensures integer multiple bin width away bin edge (center).","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/align.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Break (bin) alignment methods — align","text":"","code":"library(ggplot2)  set.seed(1234) x = rnorm(200, 1, 2)  # If we manually specify a bin width using breaks_fixed(), the default # alignment (align_none()) will not align bin edges to any \"pretty\" numbers. # Here is a comparison of the three alignment methods on such a histogram: ggplot(data.frame(x), aes(x)) +   stat_slab(     aes(y = \"align_none()\\nor 'none'\"),     density = \"histogram\",     breaks = breaks_fixed(width = 1),     outline_bars = TRUE,     # no need to specify align; align_none() is the default     color = \"black\",   ) +   stat_slab(     aes(y = \"align_center(at = 0)\\nor 'center'\"),     density = \"histogram\",     breaks = breaks_fixed(width = 1),     align = align_center(at = 0),   # or align = \"center\"     outline_bars = TRUE,     color = \"black\",   ) +   stat_slab(     aes(y = \"align_boundary(at = 0)\\nor 'boundary'\"),     density = \"histogram\",     breaks = breaks_fixed(width = 1),     align = align_boundary(at = 0), # or align = \"boundary\"     outline_bars = TRUE,     color = \"black\",   ) +   geom_point(aes(y = 0.7), alpha = 0.5) +   labs(     subtitle = \"ggdist::stat_slab(density = 'histogram', ...)\",     y = \"align =\",     x = NULL   ) +   geom_vline(xintercept = 0, linetype = \"22\", color = \"red\")"},{"path":"http://mjskay.github.io/ggdist/reference/auto_partial.html","id":null,"dir":"Reference","previous_headings":"","what":"Automatic partial function application in ggdist — auto_partial","title":"Automatic partial function application in ggdist — auto_partial","text":"Several ggdist functions support automatic partial application: called, required arguments provided, function returns modified version uses arguments passed far defaults. Technically speaking, functions essentially \"Curried\" respect required arguments, think \"automatic partial application\" gets idea across clearly. Functions supporting automatic partial application include: point_interval() family, median_qi(), mean_qi(), mode_hdi(), etc. smooth_ family, smooth_bounded(), smooth_unbounded(), smooth_discrete(), smooth_bar(). density_ family, density_bounded(), density_unbounded() density_histogram(). align family. breaks family. bandwidth family. blur family. Partial application makes easier supply custom parameters functions using inside functions, geoms stats. example, smoothers geom_dots() can supplied one three ways: suffix: geom_dots(smooth = \"bounded\") function: geom_dots(smooth = smooth_bounded) partially-applied function options: geom_dots(smooth = smooth_bounded(kernel = \"cosine\")) Many common arguments ggdist functions work similarly; e.g. density, align, breaks, bandwidth, point_interval arguments. function families (except point_interval()) also support passing waivers optional arguments: waiver() passed arguments, default value (recently-partially-applied non-waiver value) used instead. Use auto_partial() function create new functions support automatic partial application.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/auto_partial.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Automatic partial function application in ggdist — auto_partial","text":"","code":"auto_partial(f, name = NULL, waivable = TRUE)"},{"path":"http://mjskay.github.io/ggdist/reference/auto_partial.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Automatic partial function application in ggdist — auto_partial","text":"f function name character string giving name function, used printing. waivable logical: TRUE, optional arguments get passed waiver() keep default value (whatever non-waiver value recently partially applied argument).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/auto_partial.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Automatic partial function application in ggdist — auto_partial","text":"modified version f automatically partially applied required arguments given.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/auto_partial.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Automatic partial function application in ggdist — auto_partial","text":"","code":"set.seed(1234) x = rnorm(100)  # the first required argument, `x`, of the density_ family is the vector # to calculate a kernel density estimate from. If it is not provided, the # function is partially applied and returned as-is density_unbounded() #> <partial_function>:  #>   density_unbounded()  # we could create a new function that uses half the default bandwidth density_half_bw = density_unbounded(adjust = 0.5) density_half_bw #> <partial_function>:  #>   density_unbounded(adjust = 0.5)  # we can overwrite partially-applied arguments density_quarter_bw_trimmed = density_half_bw(adjust = 0.25, trim = TRUE) density_quarter_bw_trimmed #> <partial_function>:  #>   density_unbounded(adjust = 0.25, trim = TRUE)  # when we eventually call the function and provide the required argument # `x`, it is applied using the arguments we have \"saved up\" so far density_quarter_bw_trimmed(x) #>  #> Call: #> \tdensity_unbounded(x = x, adjust = 0.25, trim = TRUE) #>  #> Data: x (100 obs.);\tBandwidth 'bw' = 0.08864 #>  #>        x                 y            #>  Min.   :-2.3457   Min.   :0.009921   #>  1st Qu.:-1.1220   1st Qu.:0.062906   #>  Median : 0.1016   Median :0.149478   #>  Mean   : 0.1016   Mean   :0.201970   #>  3rd Qu.: 1.3253   3rd Qu.:0.337508   #>  Max.   : 2.5490   Max.   :0.673160    # create a custom automatically partially applied function f = auto_partial(function(x, y, z = 3) (x + y) * z) f() #> <partial_function>:  #>   f() f(1) #> <partial_function>:  #>   f(x = 1) g = f(y = 2)(z = 4) g #> <partial_function>:  #>   f(y = 2, z = 4) g(1) #> [1] 12  # pass waiver() to optional arguments to use existing values f(z = waiver())(1, 2)  # uses default z = 3 #> [1] 9 f(z = 4)(z = waiver())(1, 2)  # uses z = 4 #> [1] 12"},{"path":"http://mjskay.github.io/ggdist/reference/bandwidth.html","id":null,"dir":"Reference","previous_headings":"","what":"Bandwidth estimators — bandwidth","title":"Bandwidth estimators — bandwidth","text":"Bandwidth estimators densities, used bandwidth argument density functions (e.g. density_bounded(), density_unbounded()). Supports automatic partial function application.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/bandwidth.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Bandwidth estimators — bandwidth","text":"","code":"bandwidth_nrd0(x, ...)  bandwidth_nrd(x, ...)  bandwidth_ucv(x, ...)  bandwidth_bcv(x, ...)  bandwidth_SJ(x, ...)  bandwidth_dpi(x, ...)"},{"path":"http://mjskay.github.io/ggdist/reference/bandwidth.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Bandwidth estimators — bandwidth","text":"x numeric vector giving sample. ... Arguments passed stats::bw.SJ nb number bins use. lower,upper range minimize.  default     almost always satisfactory.  hmax calculated internally     normal reference bandwidth. method either \"ste\" (\"solve--equation\")     \"dpi\" (\"direct plug-\").   Can abbreviated. tol method \"ste\", convergence tolerance     uniroot.  default leads bandwidth estimates     slightly one digit accuracy, sufficient     practical density estimation, possibly theoretical     simulation studies.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/bandwidth.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Bandwidth estimators — bandwidth","text":"single number giving bandwidth","code":""},{"path":"http://mjskay.github.io/ggdist/reference/bandwidth.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Bandwidth estimators — bandwidth","text":"loose wrappers around corresponding bw.-prefixed functions stats. See, example, bw.SJ(). bandwidth_dpi(), default bandwidth estimator ggdist, Sheather-Jones direct plug-estimator, .e. bw.SJ(..., method = \"dpi\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/bin_dots.html","id":null,"dir":"Reference","previous_headings":"","what":"Bin data values using a dotplot algorithm — bin_dots","title":"Bin data values using a dotplot algorithm — bin_dots","text":"Bins provided data values using one several dotplot algorithms.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/bin_dots.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Bin data values using a dotplot algorithm — bin_dots","text":"","code":"bin_dots(   x,   y,   binwidth,   heightratio = 1,   stackratio = 1,   layout = c(\"bin\", \"weave\", \"hex\", \"swarm\", \"bar\"),   side = c(\"topright\", \"top\", \"right\", \"bottomleft\", \"bottom\", \"left\", \"topleft\",     \"bottomright\", \"both\"),   orientation = c(\"horizontal\", \"vertical\", \"y\", \"x\"),   overlaps = \"nudge\" )"},{"path":"http://mjskay.github.io/ggdist/reference/bin_dots.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Bin data values using a dotplot algorithm — bin_dots","text":"x numeric vector x values y numeric vector y values binwidth bin width heightratio ratio bin width dot height stackratio ratio dot height vertical distance dot centers layout layout method used dots: \"bin\" (default): places dots -axis midpoint bins classic Wilkinson dotplot. maintains alignment rows columns dotplot. layout slightly different classic Wilkinson algorithm : (1) nudges bins slightly avoid overlapping bins (2) input data symmetrical return symmetrical layout. \"weave\": uses basic binning approach \"bin\", places dots -axis actual positions (unless overlaps = \"nudge\", case overlaps may nudged way). maintains alignment rows align dots within columns. \"hex\": uses basic binning approach \"bin\", alternates placing dots + binwidth/4 - binwidth/4 -axis bin center. allows hexagonal packing setting stackratio less 1 (something like 0.9 tends work). \"swarm\": uses \"compactswarm\" layout beeswarm::beeswarm(). maintain alignment rows columns, can compact neat looking, especially sample data (opposed quantile dotplots theoretical distributions, may look better \"bin\", \"weave\", \"hex\"). \"bar\": discrete distributions, lays duplicate values rectangular bars. side side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). orientation Whether dots laid horizontally vertically. Follows naming scheme geom_slabinterval(): \"horizontal\" assumes data values dotplot x variable dots stacked y direction. \"vertical\" assumes data values dotplot y variable dots stacked x direction. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\". overlaps handle overlapping dots bins \"bin\", \"weave\", \"hex\" layouts (dots never overlap \"swarm\" \"bar\" layouts). purposes argument, dots considered overlapping overlapping dotsize = 1 stackratio = 1; .e. set arguments values, overlaps may still occur. One : \"keep\": leave overlapping dots . Dots may overlap (usually slightly) \"bin\", \"weave\", \"hex\" layouts. \"nudge\": nudge overlapping dots way. Overlaps avoided using constrained optimization minimizes squared distance dots desired positions, subject constraint adjacent dots overlap.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/bin_dots.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Bin data values using a dotplot algorithm — bin_dots","text":"data.frame three columns: x: x position dot y: y position dot bin: unique number associated bin (supplied used layout = \"swarm\")","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/bin_dots.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Bin data values using a dotplot algorithm — bin_dots","text":"","code":"library(dplyr) #>  #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #>  #>     filter, lag #> The following objects are masked from 'package:base': #>  #>     intersect, setdiff, setequal, union library(ggplot2)  x = qnorm(ppoints(20)) bin_df = bin_dots(x = x, y = 0, binwidth = 0.5, heightratio = 1) bin_df #> # A tibble: 20 × 3 #>         x     y   bin #>     <dbl> <dbl> <dbl> #>  1 -1.96   0.25     1 #>  2 -1.29   0.25     2 #>  3 -1.29   0.75     2 #>  4 -0.766  0.25     3 #>  5 -0.766  0.75     3 #>  6 -0.766  1.25     3 #>  7 -0.258  0.25     4 #>  8 -0.258  0.75     4 #>  9 -0.258  1.25     4 #> 10 -0.258  1.75     4 #> 11  0.258  0.25     5 #> 12  0.258  0.75     5 #> 13  0.258  1.25     5 #> 14  0.258  1.75     5 #> 15  0.766  0.25     6 #> 16  0.766  0.75     6 #> 17  0.766  1.25     6 #> 18  1.29   0.25     7 #> 19  1.29   0.75     7 #> 20  1.96   0.25     8  # we can manually plot the binning above, though this is only recommended # if you are using find_dotplot_binwidth() and bin_dots() to build your own # grob. For practical use it is much easier to use geom_dots(), which will # automatically select good bin widths for you (and which uses # find_dotplot_binwidth() and bin_dots() internally) bin_df %>%   ggplot(aes(x = x, y = y)) +   geom_point(size = 4) +   coord_fixed()"},{"path":"http://mjskay.github.io/ggdist/reference/blur.html","id":null,"dir":"Reference","previous_headings":"","what":"Blur functions for blurry dot plots — blur","title":"Blur functions for blurry dot plots — blur","text":"Methods constructing blurs, used blur argument geom_blur_dots() stat_mcse_dots(). Supports automatic partial function application.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/blur.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Blur functions for blurry dot plots — blur","text":"","code":"blur_gaussian(x, r, sd)  blur_interval(x, r, sd, .width = 0.95)"},{"path":"http://mjskay.github.io/ggdist/reference/blur.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Blur functions for blurry dot plots — blur","text":"x numeric vector positive distances center dot (assumed 0) evaluate blur function . r radius dot blurred. sd standard deviation dot blurred. .width blur_interval(), probability giving width interval.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/blur.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Blur functions for blurry dot plots — blur","text":"vector length x giving opacity radial gradient representing dot x value.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/blur.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Blur functions for blurry dot plots — blur","text":"functions passed x, r, sd geom_blur_dots() draws order create radial gradient representing dot dotplot. return values 0 1 giving opacity dot value x. blur_gaussian() creates dot radius r Gaussian blur standard deviation sd applied . calculating \\(\\alpha(x; r, \\sigma)\\), opacity distance \\(x\\) center dot radius \\(r\\) Gaussian blur standard deviation \\(\\sigma\\) = sd applied : $$ \\alpha(x; r, \\sigma) = \\Phi \\left(\\frac{x + r}{\\sigma} \\right) -   \\Phi \\left(\\frac{x - r}{\\sigma} \\right) $$ blur_interval() creates interval-type representation around dot 50% opacity, interval Gaussian quantile interval mass equal .width standard deviation sd.","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/blur.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Blur functions for blurry dot plots — blur","text":"","code":"# see examples in geom_blur_dots()"},{"path":"http://mjskay.github.io/ggdist/reference/bounder_cdf.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate bounds of a distribution using the CDF of its order statistics — bounder_cdf","title":"Estimate bounds of a distribution using the CDF of its order statistics — bounder_cdf","text":"Estimate bounds distribution sample came using CDF order statistics sample. Use bounder argument density_bounded(). Supports automatic partial function application.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/bounder_cdf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate bounds of a distribution using the CDF of its order statistics — bounder_cdf","text":"","code":"bounder_cdf(x, p = 0.01)"},{"path":"http://mjskay.github.io/ggdist/reference/bounder_cdf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate bounds of a distribution using the CDF of its order statistics — bounder_cdf","text":"x numeric vector containing sample estimate bounds . p scalar \\([0,1]\\): percentile order statistic distribution use estimate. p = 1 return range(x); p = 0.5 give median estimate, p = 0 give wide estimate (effectively treating distribution unbounded used density_bounded()).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/bounder_cdf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate bounds of a distribution using the CDF of its order statistics — bounder_cdf","text":"length-2 numeric vector giving estimate minimum maximum bounds distribution x came .","code":""},{"path":"http://mjskay.github.io/ggdist/reference/bounder_cdf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Estimate bounds of a distribution using the CDF of its order statistics — bounder_cdf","text":"bounder_cdf() uses distribution order statistics \\(X\\) estimate first last order statistics (.e. min max) distribution , assuming sample x distribution. , adjusts boundary outwards min(x) (max(x)) distance min(x) (max(x)) nearest estimated order statistic. Taking \\(X\\) = x, distributions first last order statistics : $$\\begin{array}{rcl} F_{X_{(1)}}(x) &=& 1 - \\left[1 - F_X(x)\\right]^n\\\\ F_{X_{(n)}}(x) &=& F_X(x)^n \\end{array}$$ Re-arranging, can get inverse CDFs (quantile functions) order statistic terms quantile function \\(X\\) (can estimate data), giving us estimate minimum maximum order statistic: $$\\begin{array}{rcrcl} \\hat{x_1} &=& F_{X_{(1)}}^{-1}(p) &=& F_X^{-1}\\left[1 - (1 - p)^{1/n}\\right]\\\\ \\hat{x_n} &=& F_{X_{(n)}}^{-1}(p) &=& F_X^{-1}\\left[p^{1/n}\\right] \\end{array}$$ estimated bounds : $$\\left[2\\min(x) - \\hat{x_1}, 2\\max(x) - \\hat{x_n} \\right]$$ bounds depend \\(p\\), percentile distribution order statistic used form estimate. \\(p = 0.5\\) (median) might reasonable choice (gives results similar bounder_cooke()), tends bit aggressive \"detecting\" bounded distributions, especially small sample sizes. Thus, use default \\(p = 0.01\\), tends conservative small samples (usually gives results roughly equivalent unbounded distribution), still performs well bounded distributions sample sizes larger (thousands).","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/bounder_cooke.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate bounds of a distribution using Cooke's method — bounder_cooke","title":"Estimate bounds of a distribution using Cooke's method — bounder_cooke","text":"Estimate bounds distribution sample came using Cooke's method. Use bounder argument density_bounded(). Supports automatic partial function application.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/bounder_cooke.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate bounds of a distribution using Cooke's method — bounder_cooke","text":"","code":"bounder_cooke(x)"},{"path":"http://mjskay.github.io/ggdist/reference/bounder_cooke.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate bounds of a distribution using Cooke's method — bounder_cooke","text":"x numeric vector containing sample estimate bounds .","code":""},{"path":"http://mjskay.github.io/ggdist/reference/bounder_cooke.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate bounds of a distribution using Cooke's method — bounder_cooke","text":"length-2 numeric vector giving estimate minimum maximum bounds distribution x came .","code":""},{"path":"http://mjskay.github.io/ggdist/reference/bounder_cooke.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Estimate bounds of a distribution using Cooke's method — bounder_cooke","text":"Estimate bounds distribution using method Cooke (1979); .e. method 2.3 Loh (1984). bounds : $$\\left[\\begin{array}{l} 2X_{(1)} - \\sum_{= 1}^n \\left[\\left(1 - \\frac{- 1}{n}\\right)^n -   \\left(1 - \\frac{}{n}\\right)^n \\right] X_{()}\\\\ 2X_{(n)} - \\sum_{= 1}^n \\left[\\left(1 - \\frac{n - }{n}\\right)^n -   \\left(1 - \\frac{n + 1 - }{n} \\right)^n\\right] X_{()} \\end{array}\\right]$$ \\(X_{()}\\) \\(\\)th order statistic x (.e. \\(\\)th-smallest value).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/bounder_cooke.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Estimate bounds of a distribution using Cooke's method — bounder_cooke","text":"Cooke, P. (1979). Statistical inference bounds random variables. Biometrika 66(2), 367--374. doi:10.1093/biomet/66.2.367 . Loh, W. Y. (1984). Estimating endpoint distribution resampling methods. Annals Statistics 12(4), 1543--1550. doi:10.1214/aos/1176346811","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/bounder_range.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate bounds of a distribution using the range of the sample — bounder_range","title":"Estimate bounds of a distribution using the range of the sample — bounder_range","text":"Estimate bounds distribution sample came using range sample. Use bounder argument density_bounded(). Supports automatic partial function application.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/bounder_range.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate bounds of a distribution using the range of the sample — bounder_range","text":"","code":"bounder_range(x)"},{"path":"http://mjskay.github.io/ggdist/reference/bounder_range.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate bounds of a distribution using the range of the sample — bounder_range","text":"x numeric vector containing sample estimate bounds .","code":""},{"path":"http://mjskay.github.io/ggdist/reference/bounder_range.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate bounds of a distribution using the range of the sample — bounder_range","text":"length-2 numeric vector giving estimate minimum maximum bounds distribution x came .","code":""},{"path":"http://mjskay.github.io/ggdist/reference/bounder_range.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Estimate bounds of a distribution using the range of the sample — bounder_range","text":"Estimate bounds distribution using range(x).","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/breaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Break (bin) selection algorithms for histograms — breaks","title":"Break (bin) selection algorithms for histograms — breaks","text":"Methods determining breaks (bins) histograms, used breaks argument density_histogram(). Supports automatic partial function application.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/breaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Break (bin) selection algorithms for histograms — breaks","text":"","code":"breaks_fixed(x, weights = NULL, width = 1)  breaks_Sturges(x, weights = NULL)  breaks_Scott(x, weights = NULL)  breaks_FD(x, weights = NULL, digits = 5)  breaks_quantiles(x, weights = NULL, max_n = \"Scott\", min_width = 0.5)"},{"path":"http://mjskay.github.io/ggdist/reference/breaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Break (bin) selection algorithms for histograms — breaks","text":"x numeric vector giving sample. weights numeric vector length(x) giving sample weights. width breaks_fixed(), desired bin width. digits breaks_FD(), number significant digits keep rounding Freedman-Diaconis algorithm. explanation parameter, see documentation corresponding parameter grDevices::nclass.FD(). max_n breaks_quantiles(), either scalar numeric giving maximum number bins, another breaks function (string giving suffix name function prefixed \"breaks_\") return maximum number bins. breaks_quantiles() construct max_n bins. min_width breaks_quantiles(), scalar numeric 0 1 giving minimum bin width proportion diff(range(x)) / max_n.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/breaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Break (bin) selection algorithms for histograms — breaks","text":"Either single number (giving number bins) vector giving edges bins.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/breaks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Break (bin) selection algorithms for histograms — breaks","text":"functions take sample weights return value suitable breaks argument density_histogram() determine histogram breaks. breaks_fixed() allows manually specify fixed bin width. breaks_Sturges(), breaks_Scott(), breaks_FD() implement weighted versions corresponding base functions. return scalar numeric giving number bins. See nclass.Sturges(), nclass.scott(), nclass.FD(). breaks_quantiles() constructs irregularly-sized bins using max_n + 1 (possibly weighted) quantiles x. final number bins max_n, small bins (ones whose bin width less half range data divided max_n times min_width) merged adjacent bins.","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/breaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Break (bin) selection algorithms for histograms — breaks","text":"","code":"library(ggplot2)  set.seed(1234) x = rnorm(200, 1, 2)  # Let's compare the different break-selection algorithms on this data: ggplot(data.frame(x), aes(x)) +   stat_slab(     aes(y = \"breaks_fixed(width = 0.5)\"),     density = \"histogram\",     breaks = breaks_fixed(width = 0.5),     outline_bars = TRUE,     color = \"black\",   ) +   stat_slab(     aes(y = \"breaks_Sturges()\\nor 'Sturges'\"),     density = \"histogram\",     breaks = \"Sturges\",     outline_bars = TRUE,     color = \"black\",   ) +   stat_slab(     aes(y = \"breaks_Scott()\\nor 'Scott'\"),     density = \"histogram\",     breaks = \"Scott\",     outline_bars = TRUE,     color = \"black\",   ) +   stat_slab(     aes(y = \"breaks_FD()\\nor 'FD'\"),     density = \"histogram\",     breaks = \"FD\",     outline_bars = TRUE,     color = \"black\",   ) +   geom_point(aes(y = 0.7), alpha = 0.5) +   labs(     subtitle = \"ggdist::stat_slab(density = 'histogram', ...)\",     y = \"breaks =\",     x = NULL   )"},{"path":"http://mjskay.github.io/ggdist/reference/curve_interval.html","id":null,"dir":"Reference","previous_headings":"","what":"Curvewise point and interval summaries for tidy data frames of draws from distributions — curve_interval","title":"Curvewise point and interval summaries for tidy data frames of draws from distributions — curve_interval","text":"Translates draws distributions grouped data frame set point interval summaries using curve boxplot-inspired approach.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/curve_interval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Curvewise point and interval summaries for tidy data frames of draws from distributions — curve_interval","text":"","code":"curve_interval(   .data,   ...,   .along = NULL,   .width = 0.5,   na.rm = FALSE,   .interval = c(\"mhd\", \"mbd\", \"bd\", \"bd-mbd\") )  # S3 method for matrix curve_interval(   .data,   ...,   .along = NULL,   .width = 0.5,   na.rm = FALSE,   .interval = c(\"mhd\", \"mbd\", \"bd\", \"bd-mbd\") )  # S3 method for rvar curve_interval(   .data,   ...,   .along = NULL,   .width = 0.5,   na.rm = FALSE,   .interval = c(\"mhd\", \"mbd\", \"bd\", \"bd-mbd\") )  # S3 method for data.frame curve_interval(   .data,   ...,   .along = NULL,   .width = 0.5,   na.rm = FALSE,   .interval = c(\"mhd\", \"mbd\", \"bd\", \"bd-mbd\"),   .simple_names = TRUE,   .exclude = c(\".chain\", \".iteration\", \".draw\", \".row\") )"},{"path":"http://mjskay.github.io/ggdist/reference/curve_interval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Curvewise point and interval summaries for tidy data frames of draws from distributions — curve_interval","text":".data One : data frame (grouped data frame returned dplyr::group_by()) contains draws summarize. posterior::rvar vector. matrix; case first dimension draws second dimension values curve. ... Bare column names expressions , evaluated context .data, represent draws summarize. empty, default columns group columns .exclude (default \".chain\", \".iteration\", \".draw\", \".row\") summarized. can numeric columns, list columns containing numeric vectors, posterior::rvar()s. .along columns input values function describing curve (e.g., \"x\" values). Supports tidyselect syntax. Intervals calculated jointly respect variables, conditional grouping variables data frame. default (NULL) causes curve_interval() use grouping variables input data frame value .along, generate conservative intervals. However, want calculate intervals function y = f(x) conditional variable(s) (say, conditional factor g), group g, use .along = x calculate intervals jointly x conditional g. avoid selecting variables input values function describing curve, use character(); produce conditional intervals (result case similar median_qi()). Currently supported .data data frame. .width vector probabilities use determine widths resulting intervals. multiple probabilities provided, multiple rows per group generated, different probability interval (value corresponding .width column). na.rm logical value indicating whether NA values stripped computation proceeds. FALSE (default), presence NA values columns summarized generally result error. TRUE, NA values removed calculation intervals long .interval \"mhd\"; methods currently support na.rm. cautious applying parameter: general, unclear joint interval values missing! .interval method used calculate intervals. Currently, methods rank curves using measure data depth, create envelopes containing .width% \"deepest\" curves. Available methods : \"mhd\": mean halfspace depth (Fraiman Muniz 2001). \"mbd\": modified band depth (Sun Genton 2011): calls fda::fbplot() method = \"MBD\". \"bd\": band depth (Sun Genton 2011): calls fda::fbplot() method = \"BD2\". \"bd-mbd\": band depth, breaking ties modified band depth (Sun Genton 2011): calls fda::fbplot() method = \"\". .simple_names TRUE single column / vector summarized, use name .lower lower end interval .upper upper end. FALSE .data data frame, names lower upper intervals column x x.lower x.upper. .exclude character vector names columns excluded summarization column names specified summarized. Default ignores several meta-data column names used ggdist tidybayes.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/curve_interval.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Curvewise point and interval summaries for tidy data frames of draws from distributions — curve_interval","text":"data frame containing point summaries intervals, least one column corresponding point summary, one lower end interval, one upper end interval, width interval (.width), type point summary (.point), type interval (.interval).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/curve_interval.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Curvewise point and interval summaries for tidy data frames of draws from distributions — curve_interval","text":"Intervals calculated ranking curves using measure data depth, using binary search find cutoff k envelope containing k% \"deepest\" curves also contains .width% curves, value .width (note k .width necessarily ). contrast functional boxplot curve boxplot approaches, tend simply take .width% deepest curves, generally quite conservative (.e. may contain .width% curves). See Mirzargar et al. (2014) Juul et al. (2020) accessible introduction data depth curve boxplots / functional boxplots.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/curve_interval.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Curvewise point and interval summaries for tidy data frames of draws from distributions — curve_interval","text":"Fraiman, Ricardo Graciela Muniz. (2001). \"Trimmed means functional data\". Test 10: 419–440. doi:10.1007/BF02595706 . Sun, Ying Marc G. Genton. (2011). \"Functional Boxplots\". Journal Computational Graphical Statistics, 20(2): 316-334. doi:10.1198/jcgs.2011.09224 Mirzargar, Mahsa, Ross T Whitaker, Robert M Kirby. (2014). \"Curve Boxplot: Generalization Boxplot Ensembles Curves\". IEEE Transactions Visualization Computer Graphics. 20(12): 2654-2663. doi:10.1109/TVCG.2014.2346455 Juul Jonas, Kaare Græsbøll, Lasse Engbo Christiansen, Sune Lehmann. (2020). \"Fixed-time descriptive statistics underestimate extremes epidemic curve ensembles\". arXiv e-print. arXiv:2007.05035","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/curve_interval.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Curvewise point and interval summaries for tidy data frames of draws from distributions — curve_interval","text":"Matthew Kay","code":""},{"path":"http://mjskay.github.io/ggdist/reference/curve_interval.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Curvewise point and interval summaries for tidy data frames of draws from distributions — curve_interval","text":"","code":"library(dplyr) library(ggplot2)  # generate a set of curves k = 11 # number of curves n = 201 df = tibble(     .draw = rep(1:k, n),     mean = rep(seq(-5,5, length.out = k), n),     x = rep(seq(-15,15,length.out = n), each = k),     y = dnorm(x, mean, 3)   )  # see pointwise intervals... df %>%   group_by(x) %>%   median_qi(y, .width = c(.5)) %>%   ggplot(aes(x = x, y = y)) +   geom_lineribbon(aes(ymin = .lower, ymax = .upper)) +   geom_line(aes(group = .draw), alpha=0.15, data = df) +   scale_fill_brewer() +   ggtitle(\"50% pointwise intervals with point_interval()\") +   theme_ggdist()   # ... compare them to curvewise intervals df %>%   group_by(x) %>%   curve_interval(y, .width = c(.5)) %>%   ggplot(aes(x = x, y = y)) +   geom_lineribbon(aes(ymin = .lower, ymax = .upper)) +   geom_line(aes(group = .draw), alpha=0.15, data = df) +   scale_fill_brewer() +   ggtitle(\"50% curvewise intervals with curve_interval()\") +   theme_ggdist()"},{"path":"http://mjskay.github.io/ggdist/reference/cut_cdf_qi.html","id":null,"dir":"Reference","previous_headings":"","what":"Categorize values from a CDF into quantile intervals — cut_cdf_qi","title":"Categorize values from a CDF into quantile intervals — cut_cdf_qi","text":"Given vector probabilities cumulative distribution function (CDF) list desired quantile intervals, return vector categorizing element input vector according quantile interval falls . NOTE: function can used (originally designed ) drawing slabs intervals overlaid density, can now done easily mapping .width level computed variable slab fill color. See Examples.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/cut_cdf_qi.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Categorize values from a CDF into quantile intervals — cut_cdf_qi","text":"","code":"cut_cdf_qi(p, .width = c(0.66, 0.95, 1), labels = NULL)"},{"path":"http://mjskay.github.io/ggdist/reference/cut_cdf_qi.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Categorize values from a CDF into quantile intervals — cut_cdf_qi","text":"p numeric vector values cumulative distribution function, values returned p-prefixed distribution functions base R (e.g. pnorm()), cdf() function, values cdf computed aesthetic stat_slabinterval() family stats. .width vector probabilities use determine widths resulting intervals. labels One : NULL use default labels (.width converted character vector). character vector giving labels (must length .width) function takes numeric probabilities input returns labels output (good candidate might scales::percent_format()).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/cut_cdf_qi.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Categorize values from a CDF into quantile intervals — cut_cdf_qi","text":"ordered factor length p giving quantile interval value p belongs.","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/cut_cdf_qi.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Categorize values from a CDF into quantile intervals — cut_cdf_qi","text":"","code":"library(ggplot2) library(dplyr) library(scales) library(distributional)  theme_set(theme_ggdist())  # NOTE: cut_cdf_qi() used to be the recommended way to do intervals overlaid # on densities, like this... tibble(x = dist_normal(0, 1)) %>%   ggplot(aes(xdist = x)) +   stat_slab(     aes(fill = after_stat(cut_cdf_qi(cdf)))   ) +   scale_fill_brewer(direction = -1)   # ... however this is now more easily and flexibly accomplished by directly # mapping .width or level onto fill: tibble(x = dist_normal(0, 1)) %>%   ggplot(aes(xdist = x)) +   stat_slab(     aes(fill = after_stat(level)),     .width = c(.66, .95, 1)   ) +   scale_fill_brewer()   # See vignette(\"slabinterval\") for more examples. The remaining examples # below using cut_cdf_qi() are kept for posterity.  # With a halfeye (or other geom with slab and interval), NA values will # show up in the fill scale from the CDF function applied to the internal # interval geometry data and can be ignored, hence na.translate = FALSE tibble(x = dist_normal(0, 1)) %>%   ggplot(aes(xdist = x)) +   stat_halfeye(aes(     fill = after_stat(cut_cdf_qi(cdf, .width = c(.5, .8, .95, 1)))   )) +   scale_fill_brewer(direction = -1, na.translate = FALSE)   # we could also use the labels parameter to apply nicer formatting # and provide a better name for the legend, and omit the 100% interval # if desired tibble(x = dist_normal(0, 1)) %>%   ggplot(aes(xdist = x)) +   stat_halfeye(aes(     fill = after_stat(cut_cdf_qi(       cdf,       .width = c(.5, .8, .95),       labels = percent_format(accuracy = 1)     ))   )) +   labs(fill = \"Interval\") +   scale_fill_brewer(direction = -1, na.translate = FALSE)"},{"path":"http://mjskay.github.io/ggdist/reference/density_bounded.html","id":null,"dir":"Reference","previous_headings":"","what":"Bounded density estimator using the reflection method — density_bounded","title":"Bounded density estimator using the reflection method — density_bounded","text":"Bounded density estimator using reflection method. Supports automatic partial function application.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/density_bounded.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Bounded density estimator using the reflection method — density_bounded","text":"","code":"density_bounded(   x,   weights = NULL,   n = 512,   bandwidth = \"dpi\",   adjust = 1,   kernel = \"gaussian\",   trim = FALSE,   bounds = c(NA, NA),   bounder = \"cdf\",   adapt = 1,   na.rm = FALSE,   ...,   range_only = FALSE )"},{"path":"http://mjskay.github.io/ggdist/reference/density_bounded.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Bounded density estimator using the reflection method — density_bounded","text":"x numeric vector containing sample compute density estimate . weights optional numeric vector weights apply x. n numeric: number grid points evaluate density estimator . bandwidth bandwidth density estimator. One : numeric: bandwidth, standard deviation kernel function: function taking x (sample) returning bandwidth string: suffix name function starting \"bandwidth_\" used determine bandwidth. See bandwidth list. adjust numeric: bandwidth density estimator multiplied value. See stats::density(). kernel string: smoothing kernel used. must partially match one \"gaussian\", \"rectangular\", \"triangular\", \"epanechnikov\", \"biweight\", \"cosine\", \"optcosine\". See stats::density(). trim density estimate trimmed bounds data? bounds length-2 vector min max bounds. bound NA, bound estimated data using method specified bounder. bounder Method use find missing (NA) bounds. function takes numeric vector values returns length-2 vector estimated lower upper bound distribution. Can also string giving suffix name function starts \"bounder_\". Useful values include: \"cdf\": Use CDF minimum maximum order statistics sample estimate bounds. See bounder_cdf(). \"cooke\": Use method Cooke (1979); .e. method 2.3 Loh (1984). See bounder_cooke(). \"range\": Use range x (.e min max). See bounder_range(). adapt (experimental) name interpretation argument subject change without notice. Positive integer. adapt > 1, uses adaptive approach calculate density. First, uses adaptive bandwidth algorithm Abramson (1982) determine local (pointwise) bandwidths, groups bandwidths adapt groups, calculates sums densities group. can set large number (e.g. Inf) fully adaptive approach, slow; typically something around 100 yields nearly identical results. na.rm missing (NA) values x removed? ... Additional arguments (ignored). range_only TRUE, range output density estimator computed returned $x element result, c(NA, NA) returned $y. gives faster way determine range output density_XXX(n = 2).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/density_bounded.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Bounded density estimator using the reflection method — density_bounded","text":"object class \"density\", mimicking output format stats::density(), following components: x: grid points density estimated. y: estimated density values. bw: bandwidth. n: sample size x input argument. call: call used produce result, quoted expression. data.name: deparsed name x input argument. .na: Always FALSE (compatibility). cdf: Values (possibly weighted) empirical cumulative distribution function x. See weighted_ecdf(). allows existing methods density objects, like print() plot(), work desired. output format (particular, x y components) also format expected density argument stat_slabinterval() smooth_ family functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/density_bounded.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Bounded density estimator using the reflection method — density_bounded","text":"Cooke, P. (1979). Statistical inference bounds random variables. Biometrika 66(2), 367--374. doi:10.1093/biomet/66.2.367 . Loh, W. Y. (1984). Estimating endpoint distribution resampling methods. Annals Statistics 12(4), 1543--1550. doi:10.1214/aos/1176346811","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/density_bounded.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Bounded density estimator using the reflection method — density_bounded","text":"","code":"library(distributional) library(dplyr) library(ggplot2)  # For compatibility with existing code, the return type of density_bounded() # is the same as stats::density(), ... set.seed(123) x = rbeta(5000, 1, 3) d = density_bounded(x) d #>  #> Call: #> \tdensity_bounded(x = x) #>  #> Data: x (5000 obs.);\tBandwidth 'bw' = 0.01647 #>  #>        x                    y             #>  Min.   :-0.0001229   Min.   :0.0009348   #>  1st Qu.: 0.2467302   1st Qu.:0.2144899   #>  Median : 0.4935833   Median :0.8152210   #>  Mean   : 0.4935833   Mean   :1.0138543   #>  3rd Qu.: 0.7404364   3rd Qu.:1.6212908   #>  Max.   : 0.9872895   Max.   :2.9045616    # ... thus, while designed for use with the `density` argument of # stat_slabinterval(), output from density_bounded() can also be used with # base::plot(): plot(d)   # here we'll use the same data as above, but pick either density_bounded() # or density_unbounded() (which is equivalent to stats::density()). Notice # how the bounded density (green) is biased near the boundary of the support, # while the unbounded density is not. data.frame(x) %>%   ggplot() +   stat_slab(     aes(xdist = dist), data = data.frame(dist = dist_beta(1, 3)),     alpha = 0.25   ) +   stat_slab(aes(x), density = \"bounded\", fill = NA, color = \"#d95f02\", alpha = 0.5) +   stat_slab(aes(x), density = \"unbounded\", fill = NA, color = \"#1b9e77\", alpha = 0.5) +   scale_thickness_shared() +   theme_ggdist()   # We can also supply arguments to the density estimators by using their # full function names instead of the string suffix; e.g. we can supply # the exact bounds of c(0,1) rather than using the bounds of the data. data.frame(x) %>%   ggplot() +   stat_slab(     aes(xdist = dist), data = data.frame(dist = dist_beta(1, 3)),     alpha = 0.25   ) +   stat_slab(     aes(x), fill = NA, color = \"#d95f02\", alpha = 0.5,     density = density_bounded(bounds = c(0,1))   ) +   scale_thickness_shared() +   theme_ggdist()"},{"path":"http://mjskay.github.io/ggdist/reference/density_histogram.html","id":null,"dir":"Reference","previous_headings":"","what":"Histogram density estimator — density_histogram","title":"Histogram density estimator — density_histogram","text":"Histogram density estimator. Supports automatic partial function application.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/density_histogram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Histogram density estimator — density_histogram","text":"","code":"density_histogram(   x,   weights = NULL,   breaks = \"Scott\",   align = \"none\",   outline_bars = FALSE,   na.rm = FALSE,   ...,   range_only = FALSE )"},{"path":"http://mjskay.github.io/ggdist/reference/density_histogram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Histogram density estimator — density_histogram","text":"x numeric vector containing sample compute density estimate . weights optional numeric vector weights apply x. breaks Determines breakpoints defining bins. Defaults \"Scott\". Similar (exactly ) breaks argument graphics::hist(). One : scalar (length-1) numeric giving number bins vector numeric giving breakpoints histogram bins function taking x weights returning either number bins vector breakpoints string giving suffix function starts \"breaks_\". ggdist provides weighted implementations \"Sturges\", \"Scott\", \"FD\" break-finding algorithms graphics::hist(), well breaks_fixed() manually setting bin width. See breaks. example, breaks = \"Sturges\" use breaks_Sturges() algorithm, breaks = 9 create 9 bins, breaks = breaks_fixed(width = 1) set bin width 1. align Determines align breakpoints defining bins. Default (\"none\") performs alignment. One : scalar (length-1) numeric giving offset subtracted breaks. offset must 0 bin width. function taking sorted vector breaks (bin edges) returning offset subtract breaks. string giving suffix function starts \"align_\" used determine alignment, align_none(), align_boundary(), align_center(). example, align = \"none\" provide alignment, align = align_center(= 0) center bin 0, align = align_boundary(= 0) align bin edge 0. outline_bars outlines bars (.e. density values 0) included? na.rm missing (NA) values x removed? ... Additional arguments (ignored). range_only TRUE, range output density estimator computed returned $x element result, c(NA, NA) returned $y. gives faster way determine range output density_XXX(n = 2).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/density_histogram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Histogram density estimator — density_histogram","text":"object class \"density\", mimicking output format stats::density(), following components: x: grid points density estimated. y: estimated density values. bw: bandwidth. n: sample size x input argument. call: call used produce result, quoted expression. data.name: deparsed name x input argument. .na: Always FALSE (compatibility). cdf: Values (possibly weighted) empirical cumulative distribution function x. See weighted_ecdf(). allows existing methods density objects, like print() plot(), work desired. output format (particular, x y components) also format expected density argument stat_slabinterval() smooth_ family functions.","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/density_histogram.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Histogram density estimator — density_histogram","text":"","code":"library(distributional) library(dplyr) library(ggplot2)  # For compatibility with existing code, the return type of density_unbounded() # is the same as stats::density(), ... set.seed(123) x = rbeta(5000, 1, 3) d = density_histogram(x) d #>  #> Call: #> \tdensity_histogram(x = x) #>  #> Data: x (5000 obs.);\tBandwidth 'bw' = 0.03788 #>  #>        x                   y           #>  Min.   :0.0000338   Min.   :0.02112   #>  1st Qu.:0.2320712   1st Qu.:0.30620   #>  Median :0.4735795   Median :0.90804   #>  Mean   :0.4735795   Mean   :1.05586   #>  3rd Qu.:0.7150879   3rd Qu.:1.63131   #>  Max.   :0.9471253   Max.   :2.88251    # ... thus, while designed for use with the `density` argument of # stat_slabinterval(), output from density_histogram() can also be used with # base::plot(): plot(d)   # here we'll use the same data as above with stat_slab(): data.frame(x) %>%   ggplot() +   stat_slab(     aes(xdist = dist), data = data.frame(dist = dist_beta(1, 3)),     alpha = 0.25   ) +   stat_slab(aes(x), density = \"histogram\", fill = NA, color = \"#d95f02\", alpha = 0.5) +   scale_thickness_shared() +   theme_ggdist()"},{"path":"http://mjskay.github.io/ggdist/reference/density_unbounded.html","id":null,"dir":"Reference","previous_headings":"","what":"Unbounded density estimator — density_unbounded","title":"Unbounded density estimator — density_unbounded","text":"Unbounded density estimator using stats::density(). Supports automatic partial function application.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/density_unbounded.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Unbounded density estimator — density_unbounded","text":"","code":"density_unbounded(   x,   weights = NULL,   n = 512,   bandwidth = \"dpi\",   adjust = 1,   kernel = \"gaussian\",   trim = FALSE,   adapt = 1,   na.rm = FALSE,   ...,   range_only = FALSE )"},{"path":"http://mjskay.github.io/ggdist/reference/density_unbounded.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Unbounded density estimator — density_unbounded","text":"x numeric vector containing sample compute density estimate . weights optional numeric vector weights apply x. n numeric: number grid points evaluate density estimator . bandwidth bandwidth density estimator. One : numeric: bandwidth, standard deviation kernel function: function taking x (sample) returning bandwidth string: suffix name function starting \"bandwidth_\" used determine bandwidth. See bandwidth list. adjust numeric: bandwidth density estimator multiplied value. See stats::density(). kernel string: smoothing kernel used. must partially match one \"gaussian\", \"rectangular\", \"triangular\", \"epanechnikov\", \"biweight\", \"cosine\", \"optcosine\". See stats::density(). trim density estimate trimmed bounds data? adapt (experimental) name interpretation argument subject change without notice. Positive integer. adapt > 1, uses adaptive approach calculate density. First, uses adaptive bandwidth algorithm Abramson (1982) determine local (pointwise) bandwidths, groups bandwidths adapt groups, calculates sums densities group. can set large number (e.g. Inf) fully adaptive approach, slow; typically something around 100 yields nearly identical results. na.rm missing (NA) values x removed? ... Additional arguments (ignored). range_only TRUE, range output density estimator computed returned $x element result, c(NA, NA) returned $y. gives faster way determine range output density_XXX(n = 2).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/density_unbounded.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Unbounded density estimator — density_unbounded","text":"object class \"density\", mimicking output format stats::density(), following components: x: grid points density estimated. y: estimated density values. bw: bandwidth. n: sample size x input argument. call: call used produce result, quoted expression. data.name: deparsed name x input argument. .na: Always FALSE (compatibility). cdf: Values (possibly weighted) empirical cumulative distribution function x. See weighted_ecdf(). allows existing methods density objects, like print() plot(), work desired. output format (particular, x y components) also format expected density argument stat_slabinterval() smooth_ family functions.","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/density_unbounded.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Unbounded density estimator — density_unbounded","text":"","code":"library(distributional) library(dplyr) library(ggplot2)  # For compatibility with existing code, the return type of density_unbounded() # is the same as stats::density(), ... set.seed(123) x = rbeta(5000, 1, 3) d = density_unbounded(x) d #>  #> Call: #> \tdensity_unbounded(x = x) #>  #> Data: x (5000 obs.);\tBandwidth 'bw' = 0.01647 #>  #>        x                  y            #>  Min.   :-0.04939   Min.   :0.000098   #>  1st Qu.: 0.21210   1st Qu.:0.181676   #>  Median : 0.47358   Median :0.674336   #>  Mean   : 0.47358   Mean   :0.955131   #>  3rd Qu.: 0.73506   3rd Qu.:1.616192   #>  Max.   : 0.99655   Max.   :2.774063    # ... thus, while designed for use with the `density` argument of # stat_slabinterval(), output from density_unbounded() can also be used with # base::plot(): plot(d)   # here we'll use the same data as above, but pick either density_bounded() # or density_unbounded() (which is equivalent to stats::density()). Notice # how the bounded density (green) is biased near the boundary of the support, # while the unbounded density is not. data.frame(x) %>%   ggplot() +   stat_slab(     aes(xdist = dist), data = data.frame(dist = dist_beta(1, 3)),     alpha = 0.25   ) +   stat_slab(aes(x), density = \"bounded\", fill = NA, color = \"#d95f02\", alpha = 0.5) +   stat_slab(aes(x), density = \"unbounded\", fill = NA, color = \"#1b9e77\", alpha = 0.5) +   scale_thickness_shared() +   theme_ggdist()"},{"path":"http://mjskay.github.io/ggdist/reference/find_dotplot_binwidth.html","id":null,"dir":"Reference","previous_headings":"","what":"Dynamically select a good bin width for a dotplot — find_dotplot_binwidth","title":"Dynamically select a good bin width for a dotplot — find_dotplot_binwidth","text":"Searches nice-looking bin width use draw dotplot height dotplot fits within given space (maxheight).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/find_dotplot_binwidth.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dynamically select a good bin width for a dotplot — find_dotplot_binwidth","text":"","code":"find_dotplot_binwidth(   x,   maxheight,   heightratio = 1,   stackratio = 1,   layout = c(\"bin\", \"weave\", \"hex\", \"swarm\", \"bar\") )"},{"path":"http://mjskay.github.io/ggdist/reference/find_dotplot_binwidth.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dynamically select a good bin width for a dotplot — find_dotplot_binwidth","text":"x numeric vector values maxheight maximum height dotplot heightratio ratio bin width dot height stackratio ratio dot height vertical distance dot centers layout layout method used dots: \"bin\" (default): places dots -axis midpoint bins classic Wilkinson dotplot. maintains alignment rows columns dotplot. layout slightly different classic Wilkinson algorithm : (1) nudges bins slightly avoid overlapping bins (2) input data symmetrical return symmetrical layout. \"weave\": uses basic binning approach \"bin\", places dots -axis actual positions (unless overlaps = \"nudge\", case overlaps may nudged way). maintains alignment rows align dots within columns. \"hex\": uses basic binning approach \"bin\", alternates placing dots + binwidth/4 - binwidth/4 -axis bin center. allows hexagonal packing setting stackratio less 1 (something like 0.9 tends work). \"swarm\": uses \"compactswarm\" layout beeswarm::beeswarm(). maintain alignment rows columns, can compact neat looking, especially sample data (opposed quantile dotplots theoretical distributions, may look better \"bin\", \"weave\", \"hex\"). \"bar\": discrete distributions, lays duplicate values rectangular bars.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/find_dotplot_binwidth.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Dynamically select a good bin width for a dotplot — find_dotplot_binwidth","text":"suitable bin width dotplot created bin width heightratio tallest bin less equal maxheight.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/find_dotplot_binwidth.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Dynamically select a good bin width for a dotplot — find_dotplot_binwidth","text":"dynamic bin selection algorithm uses binary search number bins find bin width input data (x) binned using Wilkinson-style dotplot algorithm height tallest bin less maxheight. algorithm used geom_dotsinterval() (variants) automatically select bin widths. Unless manually implementing dotplot grob geom, probably need use function directly","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/find_dotplot_binwidth.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Dynamically select a good bin width for a dotplot — find_dotplot_binwidth","text":"","code":"library(dplyr) library(ggplot2)  x = qnorm(ppoints(20)) binwidth = find_dotplot_binwidth(x, maxheight = 4, heightratio = 1) binwidth #> [1] 0.755415  bin_df = bin_dots(x = x, y = 0, binwidth = binwidth, heightratio = 1) bin_df #> # A tibble: 20 × 3 #>         x     y   bin #>     <dbl> <dbl> <dbl> #>  1 -1.96  0.378     1 #>  2 -1.13  0.378     2 #>  3 -1.13  1.13      2 #>  4 -1.13  1.89      2 #>  5 -1.13  2.64      2 #>  6 -0.378 0.378     3 #>  7 -0.378 1.13      3 #>  8 -0.378 1.89      3 #>  9 -0.378 2.64      3 #> 10 -0.378 3.40      3 #> 11  0.378 0.378     4 #> 12  0.378 1.13      4 #> 13  0.378 1.89      4 #> 14  0.378 2.64      4 #> 15  0.378 3.40      4 #> 16  1.13  0.378     5 #> 17  1.13  1.13      5 #> 18  1.13  1.89      5 #> 19  1.13  2.64      5 #> 20  1.96  0.378     6  # we can manually plot the binning above, though this is only recommended # if you are using find_dotplot_binwidth() and bin_dots() to build your own # grob. For practical use it is much easier to use geom_dots(), which will # automatically select good bin widths for you (and which uses # find_dotplot_binwidth() and bin_dots() internally) bin_df %>%   ggplot(aes(x = x, y = y)) +   geom_point(size = 4) +   coord_fixed()"},{"path":"http://mjskay.github.io/ggdist/reference/geom_blur_dots.html","id":null,"dir":"Reference","previous_headings":"","what":"Blurry dot plot (geom) — geom_blur_dots","title":"Blurry dot plot (geom) — geom_blur_dots","text":"Variant geom_dots() creating blurry dotplots. Accepts sd aesthetic gives standard deviation blur applied dots. Requires graphics engine supporting radial gradients. Unlike geom_dots(), dots must circular, geom support shape aesthetic.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_blur_dots.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Blurry dot plot (geom) — geom_blur_dots","text":"","code":"geom_blur_dots(   mapping = NULL,   data = NULL,   stat = \"identity\",   position = \"identity\",   ...,   blur = \"gaussian\",   binwidth = NA,   dotsize = 1.07,   stackratio = 1,   layout = \"bin\",   overlaps = \"nudge\",   smooth = \"none\",   overflow = \"warn\",   verbose = FALSE,   orientation = NA,   subguide = \"none\",   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/geom_blur_dots.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Blurry dot plot (geom) — geom_blur_dots","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). stat statistical transformation use data layer, either ggproto Geom subclass string naming stat stripped stat_ prefix (e.g. \"count\" rather \"stat_count\") position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. blur Blur function apply dots. One : function takes numeric vector distances dot center, dot radius, standard deviation blur returns vector opacities \\([0, 1]\\), blur_gaussian() blur_interval(). string indicating blur function use, suffix function name starting blur_; e.g. \"gaussian\" (default) applies blur_gaussian(). binwidth bin width use laying dots. One : NA (default): Dynamically select bin width based size plot drawn. pick binwidth tallest stack dots scale height (ideally exactly scale height, though guaranteed). length-1 (scalar) numeric unit object giving exact bin width. length-2 (vector) numeric unit object giving minimum maximum desired bin width. bin width dynamically selected within bounds. value numeric, assumed units data. bin width (bounds) can also specified using unit(), may useful desired dots certain point size certain percentage width/height viewport. example, unit(0.1, \"npc\") make dots exactly 10% viewport size along whichever dimension dotplot drawn; unit(c(0, 0.1), \"npc\") make dots 10% viewport size (still ensuring tallest stack less equal scale). dotsize width dots relative binwidth. default, 1.07, makes dots just bit wider bin width, manually-tuned parameter tends work well default circular shape, preventing gaps bins appearing large visually (might arise dots precisely binwidth). desired dots precisely binwidth, set dotsize = 1. stackratio distance center dots stack relative dot height. default, 1, makes dots stack just touch . layout layout method used dots: \"bin\" (default): places dots -axis midpoint bins classic Wilkinson dotplot. maintains alignment rows columns dotplot. layout slightly different classic Wilkinson algorithm : (1) nudges bins slightly avoid overlapping bins (2) input data symmetrical return symmetrical layout. \"weave\": uses basic binning approach \"bin\", places dots -axis actual positions (unless overlaps = \"nudge\", case overlaps may nudged way). maintains alignment rows align dots within columns. \"hex\": uses basic binning approach \"bin\", alternates placing dots + binwidth/4 - binwidth/4 -axis bin center. allows hexagonal packing setting stackratio less 1 (something like 0.9 tends work). \"swarm\": uses \"compactswarm\" layout beeswarm::beeswarm(). maintain alignment rows columns, can compact neat looking, especially sample data (opposed quantile dotplots theoretical distributions, may look better \"bin\", \"weave\", \"hex\"). \"bar\": discrete distributions, lays duplicate values rectangular bars. overlaps handle overlapping dots bins \"bin\", \"weave\", \"hex\" layouts (dots never overlap \"swarm\" \"bar\" layouts). purposes argument, dots considered overlapping overlapping dotsize = 1 stackratio = 1; .e. set arguments values, overlaps may still occur. One : \"keep\": leave overlapping dots . Dots may overlap (usually slightly) \"bin\", \"weave\", \"hex\" layouts. \"nudge\": nudge overlapping dots way. Overlaps avoided using constrained optimization minimizes squared distance dots desired positions, subject constraint adjacent dots overlap. smooth Smoother apply dot positions. One : function takes numeric vector dot positions returns smoothed version vector, smooth_bounded(), smooth_unbounded(), smooth_discrete(), smooth_bar()`. string indicating smoother use, suffix function name starting smooth_; e.g. \"none\" (default) applies smooth_none(), simply returns given vector without applying smoothing. Smoothing effective smoother matched support distribution; e.g. using smooth_bounded(bounds = ...). overflow handle overflow dots beyond extent geom minimum binwidth (exact binwidth) supplied. One : \"keep\": Keep overflow, drawing dots outside geom bounds. \"warn\": Keep overflow, produce warning suggesting solutions, setting binwidth = NA overflow = \"compress\". \"compress\": Compress layout. Reduces binwidth size necessary keep dots within bounds, adjusts stackratio dotsize apparent dot size user-specified minimum binwidth times user-specified dotsize. find default layout dots small, okay dots overlapping, consider setting overflow = \"compress\" supplying exact minimum dot size using binwidth. verbose TRUE, print bin width dotplot. Can useful want start automatically-selected bin width adjust manually. Bin width printed data units normalized parent coordinates \"npc\"s (see unit()). Note just want scale selected bin width fit within desired area, probably easier use scale copy scale binwidth manually, just want provide constraints bin width, can pass length-2 vector binwidth. orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. can also named logical vector finely select aesthetics display. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_blur_dots.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Blurry dot plot (geom) — geom_blur_dots","text":"ggplot2::Geom representing blurry dot geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_blur_dots.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Blurry dot plot (geom) — geom_blur_dots","text":"dots family stats geoms similar geom_dotplot() number differences: Dots geoms act like slabs geom_slabinterval() can given x positions (y positions horizontal orientation). Given available space lay dots, dots geoms automatically determine many bins use fit available space. Dots geoms use dynamic layout algorithm lays dots center input data symmetrical, guaranteeing symmetrical data results symmetrical plot. layout algorithm also prevents dots overlapping . shape dots geoms can changed using slab_shape aesthetic (using dotsinterval family) shape slab_shape aesthetic (using dots family) Stats geoms family include: geom_dots(): dotplots raw data. Ensures dotplot fits within available space reducing size dots automatically (may result small dots). geom_swarm() geom_weave(): dotplots raw data defaults intended create \"beeswarm\" plots. Used side = \"\" default, sets default dot size size geom_point() (binwidth = unit(1.5, \"mm\")), allowing dots overlap instead getting small. stat_dots(): dotplots raw data, distributional objects, posterior::rvar()s geom_dotsinterval(): dotplot + interval plots raw data already-calculated intervals (rarely useful directly). stat_dotsinterval(): dotplot + interval plots raw data, distributional objects, posterior::rvar()s (calculate intervals ). geom_blur_dots(): blurry dotplots allow standard deviation blur applied dot specified using sd aesthetic. stat_mcse_dots(): blurry dotplots quantiles using Monte Carlo Standard Error quantile. stat_dots() stat_dotsinterval(), used quantiles argument, particularly useful constructing quantile dotplots, can effective way communicate uncertainty using frequency framing may easier laypeople understand (Kay et al. 2016, Fernandes et al. 2018).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_blur_dots.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Blurry dot plot (geom) — geom_blur_dots","text":"dots+interval stats geoms wide variety aesthetics control appearance three sub-geometries: dots (aka slab), point, interval. Positional aesthetics x: x position geometry y: y position geometry Dots-specific (aka Slab-specific) aesthetics sd: standard deviation (data units) blur associated dot. order: order data points stacked within bins. Can used create effect \"stacked\" dots ordering dots according discrete variable. omitted (NULL), value data points used determine stacking order. applies layout \"bin\" \"hex\", layout methods fully determine x y positions. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. justification: Justification interval relative slab, 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). justification NULL (default), set automatically based value side: side \"top\"/\"right\" justification set 0, side \"bottom\"/\"left\" justification set 1, side \"\" justification set 0.5. datatype: using composite geoms directly without stat (e.g. geom_slabinterval()), datatype used indicate part geom row data targets: rows datatype = \"slab\" target slab portion geometry rows datatype = \"interval\" target interval portion geometry. set automatically using ggdist stats. Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Slab-specific color line override aesthetics slab_fill: Override fill: fill color slab. slab_colour: (slab_color) Override colour/color: outline color slab. slab_alpha: Override alpha: opacity slab. slab_linewidth: Override linwidth: width outline slab. slab_linetype: Override linetype: line type outline slab. slab_shape: Override shape: shape dots used draw dotplot slab. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Point-specific color line override aesthetics point_fill: Override fill: fill color point. point_colour: (point_color) Override colour/color: outline color point. point_alpha: Override alpha: opacity point. point_size: Override size: size point. Deprecated aesthetics slab_size: Use slab_linewidth. interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"dotsinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_blur_dots.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Blurry dot plot (geom) — geom_blur_dots","text":"Kay, M., Kola, T., Hullman, J. R., & Munson, S. . (2016). (ish) Bus? User-centered Visualizations Uncertainty Everyday, Mobile Predictive Systems. Conference Human Factors Computing Systems - CHI '16, 5092--5103. doi:10.1145/2858036.2858558 . Fernandes, M., Walls, L., Munson, S., Hullman, J., & Kay, M. (2018). Uncertainty Displays Using Quantile Dotplots CDFs Improve Transit Decision-Making. Conference Human Factors Computing Systems - CHI '18. doi:10.1145/3173574.3173718 .","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/geom_blur_dots.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Blurry dot plot (geom) — geom_blur_dots","text":"","code":"library(dplyr) library(ggplot2)  theme_set(theme_ggdist())  set.seed(1234) x = rnorm(1000)  # manually calculate quantiles and their MCSE # this could also be done more succinctly with stat_mcse_dots() p = ppoints(100) df = data.frame(   q = quantile(x, p),   se = posterior::mcse_quantile(x, p) )  df %>%   ggplot(aes(x = q, sd = se)) +   geom_blur_dots()   df %>%   ggplot(aes(x = q, sd = se)) +   # or blur = blur_interval(.width = .95) to set the interval width   geom_blur_dots(blur = \"interval\")"},{"path":"http://mjskay.github.io/ggdist/reference/geom_dots.html","id":null,"dir":"Reference","previous_headings":"","what":"Dot plot (shortcut geom) — geom_dots","title":"Dot plot (shortcut geom) — geom_dots","text":"Shortcut version geom_dotsinterval() creating dot plots. Geoms based geom_dotsinterval() create dotplots automatically ensure plot fits within available space. Roughly equivalent :","code":"geom_dotsinterval(   show_point = FALSE,   show_interval = FALSE )"},{"path":"http://mjskay.github.io/ggdist/reference/geom_dots.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dot plot (shortcut geom) — geom_dots","text":"","code":"geom_dots(   mapping = NULL,   data = NULL,   stat = \"identity\",   position = \"identity\",   ...,   binwidth = NA,   dotsize = 1.07,   stackratio = 1,   layout = \"bin\",   overlaps = \"nudge\",   smooth = \"none\",   overflow = \"warn\",   verbose = FALSE,   orientation = NA,   subguide = \"none\",   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/geom_dots.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dot plot (shortcut geom) — geom_dots","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). stat statistical transformation use data layer, either ggproto Geom subclass string naming stat stripped stat_ prefix (e.g. \"count\" rather \"stat_count\") position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. binwidth bin width use laying dots. One : NA (default): Dynamically select bin width based size plot drawn. pick binwidth tallest stack dots scale height (ideally exactly scale height, though guaranteed). length-1 (scalar) numeric unit object giving exact bin width. length-2 (vector) numeric unit object giving minimum maximum desired bin width. bin width dynamically selected within bounds. value numeric, assumed units data. bin width (bounds) can also specified using unit(), may useful desired dots certain point size certain percentage width/height viewport. example, unit(0.1, \"npc\") make dots exactly 10% viewport size along whichever dimension dotplot drawn; unit(c(0, 0.1), \"npc\") make dots 10% viewport size (still ensuring tallest stack less equal scale). dotsize width dots relative binwidth. default, 1.07, makes dots just bit wider bin width, manually-tuned parameter tends work well default circular shape, preventing gaps bins appearing large visually (might arise dots precisely binwidth). desired dots precisely binwidth, set dotsize = 1. stackratio distance center dots stack relative dot height. default, 1, makes dots stack just touch . layout layout method used dots: \"bin\" (default): places dots -axis midpoint bins classic Wilkinson dotplot. maintains alignment rows columns dotplot. layout slightly different classic Wilkinson algorithm : (1) nudges bins slightly avoid overlapping bins (2) input data symmetrical return symmetrical layout. \"weave\": uses basic binning approach \"bin\", places dots -axis actual positions (unless overlaps = \"nudge\", case overlaps may nudged way). maintains alignment rows align dots within columns. \"hex\": uses basic binning approach \"bin\", alternates placing dots + binwidth/4 - binwidth/4 -axis bin center. allows hexagonal packing setting stackratio less 1 (something like 0.9 tends work). \"swarm\": uses \"compactswarm\" layout beeswarm::beeswarm(). maintain alignment rows columns, can compact neat looking, especially sample data (opposed quantile dotplots theoretical distributions, may look better \"bin\", \"weave\", \"hex\"). \"bar\": discrete distributions, lays duplicate values rectangular bars. overlaps handle overlapping dots bins \"bin\", \"weave\", \"hex\" layouts (dots never overlap \"swarm\" \"bar\" layouts). purposes argument, dots considered overlapping overlapping dotsize = 1 stackratio = 1; .e. set arguments values, overlaps may still occur. One : \"keep\": leave overlapping dots . Dots may overlap (usually slightly) \"bin\", \"weave\", \"hex\" layouts. \"nudge\": nudge overlapping dots way. Overlaps avoided using constrained optimization minimizes squared distance dots desired positions, subject constraint adjacent dots overlap. smooth Smoother apply dot positions. One : function takes numeric vector dot positions returns smoothed version vector, smooth_bounded(), smooth_unbounded(), smooth_discrete(), smooth_bar()`. string indicating smoother use, suffix function name starting smooth_; e.g. \"none\" (default) applies smooth_none(), simply returns given vector without applying smoothing. Smoothing effective smoother matched support distribution; e.g. using smooth_bounded(bounds = ...). overflow handle overflow dots beyond extent geom minimum binwidth (exact binwidth) supplied. One : \"keep\": Keep overflow, drawing dots outside geom bounds. \"warn\": Keep overflow, produce warning suggesting solutions, setting binwidth = NA overflow = \"compress\". \"compress\": Compress layout. Reduces binwidth size necessary keep dots within bounds, adjusts stackratio dotsize apparent dot size user-specified minimum binwidth times user-specified dotsize. find default layout dots small, okay dots overlapping, consider setting overflow = \"compress\" supplying exact minimum dot size using binwidth. verbose TRUE, print bin width dotplot. Can useful want start automatically-selected bin width adjust manually. Bin width printed data units normalized parent coordinates \"npc\"s (see unit()). Note just want scale selected bin width fit within desired area, probably easier use scale copy scale binwidth manually, just want provide constraints bin width, can pass length-2 vector binwidth. orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. can also named logical vector finely select aesthetics display. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_dots.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Dot plot (shortcut geom) — geom_dots","text":"ggplot2::Geom representing dot geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_dots.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Dot plot (shortcut geom) — geom_dots","text":"dots family stats geoms similar geom_dotplot() number differences: Dots geoms act like slabs geom_slabinterval() can given x positions (y positions horizontal orientation). Given available space lay dots, dots geoms automatically determine many bins use fit available space. Dots geoms use dynamic layout algorithm lays dots center input data symmetrical, guaranteeing symmetrical data results symmetrical plot. layout algorithm also prevents dots overlapping . shape dots geoms can changed using slab_shape aesthetic (using dotsinterval family) shape slab_shape aesthetic (using dots family) Stats geoms family include: geom_dots(): dotplots raw data. Ensures dotplot fits within available space reducing size dots automatically (may result small dots). geom_swarm() geom_weave(): dotplots raw data defaults intended create \"beeswarm\" plots. Used side = \"\" default, sets default dot size size geom_point() (binwidth = unit(1.5, \"mm\")), allowing dots overlap instead getting small. stat_dots(): dotplots raw data, distributional objects, posterior::rvar()s geom_dotsinterval(): dotplot + interval plots raw data already-calculated intervals (rarely useful directly). stat_dotsinterval(): dotplot + interval plots raw data, distributional objects, posterior::rvar()s (calculate intervals ). geom_blur_dots(): blurry dotplots allow standard deviation blur applied dot specified using sd aesthetic. stat_mcse_dots(): blurry dotplots quantiles using Monte Carlo Standard Error quantile. stat_dots() stat_dotsinterval(), used quantiles argument, particularly useful constructing quantile dotplots, can effective way communicate uncertainty using frequency framing may easier laypeople understand (Kay et al. 2016, Fernandes et al. 2018).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_dots.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Dot plot (shortcut geom) — geom_dots","text":"dots+interval stats geoms wide variety aesthetics control appearance three sub-geometries: dots (aka slab), point, interval. Positional aesthetics x: x position geometry y: y position geometry Dots-specific (aka Slab-specific) aesthetics family: font family used draw dots. order: order data points stacked within bins. Can used create effect \"stacked\" dots ordering dots according discrete variable. omitted (NULL), value data points used determine stacking order. applies layout \"bin\" \"hex\", layout methods fully determine x y positions. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. justification: Justification interval relative slab, 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). justification NULL (default), set automatically based value side: side \"top\"/\"right\" justification set 0, side \"bottom\"/\"left\" justification set 1, side \"\" justification set 0.5. datatype: using composite geoms directly without stat (e.g. geom_slabinterval()), datatype used indicate part geom row data targets: rows datatype = \"slab\" target slab portion geometry rows datatype = \"interval\" target interval portion geometry. set automatically using ggdist stats. Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Point-specific aesthetics shape: Shape type used draw point sub-geometry. Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Slab-specific color line override aesthetics slab_fill: Override fill: fill color slab. slab_colour: (slab_color) Override colour/color: outline color slab. slab_alpha: Override alpha: opacity slab. slab_linewidth: Override linwidth: width outline slab. slab_linetype: Override linetype: line type outline slab. slab_shape: Override shape: shape dots used draw dotplot slab. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Point-specific color line override aesthetics point_fill: Override fill: fill color point. point_colour: (point_color) Override colour/color: outline color point. point_alpha: Override alpha: opacity point. point_size: Override size: size point. Deprecated aesthetics slab_size: Use slab_linewidth. interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"dotsinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_dots.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Dot plot (shortcut geom) — geom_dots","text":"Kay, M., Kola, T., Hullman, J. R., & Munson, S. . (2016). (ish) Bus? User-centered Visualizations Uncertainty Everyday, Mobile Predictive Systems. Conference Human Factors Computing Systems - CHI '16, 5092--5103. doi:10.1145/2858036.2858558 . Fernandes, M., Walls, L., Munson, S., Hullman, J., & Kay, M. (2018). Uncertainty Displays Using Quantile Dotplots CDFs Improve Transit Decision-Making. Conference Human Factors Computing Systems - CHI '18. doi:10.1145/3173574.3173718 .","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/geom_dots.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Dot plot (shortcut geom) — geom_dots","text":"","code":"library(dplyr) library(ggplot2)  theme_set(theme_ggdist())  set.seed(12345) df = tibble(   g = rep(c(\"a\", \"b\"), 200),   value = rnorm(400, c(0, 3), c(0.75, 1)) )  # orientation is detected automatically based on # which axis is discrete  df %>%   ggplot(aes(x = value, y = g)) +   geom_dots()   df %>%   ggplot(aes(y = value, x = g)) +   geom_dots()"},{"path":"http://mjskay.github.io/ggdist/reference/geom_dotsinterval.html","id":null,"dir":"Reference","previous_headings":"","what":"Automatic dotplot + point + interval meta-geom — geom_dotsinterval","title":"Automatic dotplot + point + interval meta-geom — geom_dotsinterval","text":"meta-geom supports drawing combinations dotplots, points, intervals. Geoms stats based geom_dotsinterval() create dotplots automatically determine bin width ensures plot fits within available space. also ensure dots overlap, allow generation quantile dotplots using quantiles argument stat_dotsinterval()/stat_dots(). Generally follows naming scheme arguments geom_slabinterval() stat_slabinterval() family geoms stats.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_dotsinterval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Automatic dotplot + point + interval meta-geom — geom_dotsinterval","text":"","code":"geom_dotsinterval(   mapping = NULL,   data = NULL,   stat = \"identity\",   position = \"identity\",   ...,   binwidth = NA,   dotsize = 1.07,   stackratio = 1,   layout = \"bin\",   overlaps = \"nudge\",   smooth = \"none\",   overflow = \"warn\",   verbose = FALSE,   orientation = NA,   interval_size_domain = c(1, 6),   interval_size_range = c(0.6, 1.4),   fatten_point = 1.8,   arrow = NULL,   show_slab = TRUE,   show_point = TRUE,   show_interval = TRUE,   subguide = \"none\",   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/geom_dotsinterval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Automatic dotplot + point + interval meta-geom — geom_dotsinterval","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). stat statistical transformation use data layer, either ggproto Geom subclass string naming stat stripped stat_ prefix (e.g. \"count\" rather \"stat_count\") position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. binwidth bin width use laying dots. One : NA (default): Dynamically select bin width based size plot drawn. pick binwidth tallest stack dots scale height (ideally exactly scale height, though guaranteed). length-1 (scalar) numeric unit object giving exact bin width. length-2 (vector) numeric unit object giving minimum maximum desired bin width. bin width dynamically selected within bounds. value numeric, assumed units data. bin width (bounds) can also specified using unit(), may useful desired dots certain point size certain percentage width/height viewport. example, unit(0.1, \"npc\") make dots exactly 10% viewport size along whichever dimension dotplot drawn; unit(c(0, 0.1), \"npc\") make dots 10% viewport size (still ensuring tallest stack less equal scale). dotsize width dots relative binwidth. default, 1.07, makes dots just bit wider bin width, manually-tuned parameter tends work well default circular shape, preventing gaps bins appearing large visually (might arise dots precisely binwidth). desired dots precisely binwidth, set dotsize = 1. stackratio distance center dots stack relative dot height. default, 1, makes dots stack just touch . layout layout method used dots: \"bin\" (default): places dots -axis midpoint bins classic Wilkinson dotplot. maintains alignment rows columns dotplot. layout slightly different classic Wilkinson algorithm : (1) nudges bins slightly avoid overlapping bins (2) input data symmetrical return symmetrical layout. \"weave\": uses basic binning approach \"bin\", places dots -axis actual positions (unless overlaps = \"nudge\", case overlaps may nudged way). maintains alignment rows align dots within columns. \"hex\": uses basic binning approach \"bin\", alternates placing dots + binwidth/4 - binwidth/4 -axis bin center. allows hexagonal packing setting stackratio less 1 (something like 0.9 tends work). \"swarm\": uses \"compactswarm\" layout beeswarm::beeswarm(). maintain alignment rows columns, can compact neat looking, especially sample data (opposed quantile dotplots theoretical distributions, may look better \"bin\", \"weave\", \"hex\"). \"bar\": discrete distributions, lays duplicate values rectangular bars. overlaps handle overlapping dots bins \"bin\", \"weave\", \"hex\" layouts (dots never overlap \"swarm\" \"bar\" layouts). purposes argument, dots considered overlapping overlapping dotsize = 1 stackratio = 1; .e. set arguments values, overlaps may still occur. One : \"keep\": leave overlapping dots . Dots may overlap (usually slightly) \"bin\", \"weave\", \"hex\" layouts. \"nudge\": nudge overlapping dots way. Overlaps avoided using constrained optimization minimizes squared distance dots desired positions, subject constraint adjacent dots overlap. smooth Smoother apply dot positions. One : function takes numeric vector dot positions returns smoothed version vector, smooth_bounded(), smooth_unbounded(), smooth_discrete(), smooth_bar()`. string indicating smoother use, suffix function name starting smooth_; e.g. \"none\" (default) applies smooth_none(), simply returns given vector without applying smoothing. Smoothing effective smoother matched support distribution; e.g. using smooth_bounded(bounds = ...). overflow handle overflow dots beyond extent geom minimum binwidth (exact binwidth) supplied. One : \"keep\": Keep overflow, drawing dots outside geom bounds. \"warn\": Keep overflow, produce warning suggesting solutions, setting binwidth = NA overflow = \"compress\". \"compress\": Compress layout. Reduces binwidth size necessary keep dots within bounds, adjusts stackratio dotsize apparent dot size user-specified minimum binwidth times user-specified dotsize. find default layout dots small, okay dots overlapping, consider setting overflow = \"compress\" supplying exact minimum dot size using binwidth. verbose TRUE, print bin width dotplot. Can useful want start automatically-selected bin width adjust manually. Bin width printed data units normalized parent coordinates \"npc\"s (see unit()). Note just want scale selected bin width fit within desired area, probably easier use scale copy scale binwidth manually, just want provide constraints bin width, can pass length-2 vector binwidth. orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). interval_size_domain length-2 numeric vector giving minimum maximum values size linewidth aesthetics translated actual sizes intervals drawn according interval_size_range (see documentation argument.) interval_size_range length-2 numeric vector. geom scales raw size aesthetic values drawing interval point sizes, tend thick using default settings scale_size_continuous(), give sizes range c(1, 6). interval_size_domain value indicates input domain raw size values (typically equal value range argument scale_size_continuous() function), interval_size_range indicates desired output range size values (min max actual sizes used draw intervals). time recommended change value argument, may result strange scaling legends; argument holdover earlier versions size aesthetics targeting point interval separately. want adjust size interval points separately, can also use linewidth point_size aesthetics; see sub-geometry-scales. fatten_point multiplicative factor used adjust size point relative size thickest interval line. wish specify point sizes directly, can also use point_size aesthetic scale_point_size_continuous() scale_point_size_discrete(); sizes specified aesthetic adjusted using fatten_point. arrow grid::arrow() giving arrow heads use interval, NULL arrows. show_slab slab portion geom drawn? show_point point portion geom drawn? show_interval interval portion geom drawn? subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. can also named logical vector finely select aesthetics display. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_dotsinterval.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Automatic dotplot + point + interval meta-geom — geom_dotsinterval","text":"ggplot2::Geom ggplot2::Stat representing dotplot combined dotplot+interval geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_dotsinterval.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Automatic dotplot + point + interval meta-geom — geom_dotsinterval","text":"dots family stats geoms similar geom_dotplot() number differences: Dots geoms act like slabs geom_slabinterval() can given x positions (y positions horizontal orientation). Given available space lay dots, dots geoms automatically determine many bins use fit available space. Dots geoms use dynamic layout algorithm lays dots center input data symmetrical, guaranteeing symmetrical data results symmetrical plot. layout algorithm also prevents dots overlapping . shape dots geoms can changed using slab_shape aesthetic (using dotsinterval family) shape slab_shape aesthetic (using dots family) Stats geoms family include: geom_dots(): dotplots raw data. Ensures dotplot fits within available space reducing size dots automatically (may result small dots). geom_swarm() geom_weave(): dotplots raw data defaults intended create \"beeswarm\" plots. Used side = \"\" default, sets default dot size size geom_point() (binwidth = unit(1.5, \"mm\")), allowing dots overlap instead getting small. stat_dots(): dotplots raw data, distributional objects, posterior::rvar()s geom_dotsinterval(): dotplot + interval plots raw data already-calculated intervals (rarely useful directly). stat_dotsinterval(): dotplot + interval plots raw data, distributional objects, posterior::rvar()s (calculate intervals ). geom_blur_dots(): blurry dotplots allow standard deviation blur applied dot specified using sd aesthetic. stat_mcse_dots(): blurry dotplots quantiles using Monte Carlo Standard Error quantile. stat_dots() stat_dotsinterval(), used quantiles argument, particularly useful constructing quantile dotplots, can effective way communicate uncertainty using frequency framing may easier laypeople understand (Kay et al. 2016, Fernandes et al. 2018). visualize sample data, data distribution, samples bootstrap distribution, Bayesian posterior, can supply samples x y aesthetic. visualize analytical distributions, can use xdist ydist aesthetic. historical reasons, can also use dist specify distribution, though recommended work well orientation detection. aesthetics can used follows: xdist, ydist, dist can distribution object distributional package (dist_normal(), dist_beta(), etc) can posterior::rvar() object. Since functions vectorized, columns can passed directly aes() specification; e.g. aes(dist = dist_normal(mu, sigma)) work mu sigma columns input data frame. dist can character vector giving distribution name.  arg1, ... arg9 aesthetics (args list column) specify distribution arguments. Distribution names correspond R functions \"p\", \"q\", \"d\" functions; e.g. \"norm\" valid distribution name R defines pnorm(), qnorm(), dnorm() functions Normal distributions. See parse_dist() function useful way generate dist args values human-readable distribution specs (like \"normal(0,1)\"). specs also produced packages (like brms::get_prior function brms); thus, parse_dist() combined stats described can help visualize output functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_dotsinterval.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Automatic dotplot + point + interval meta-geom — geom_dotsinterval","text":"dots+interval stats geoms wide variety aesthetics control appearance three sub-geometries: dots (aka slab), point, interval. Positional aesthetics x: x position geometry y: y position geometry Dots-specific (aka Slab-specific) aesthetics family: font family used draw dots. order: order data points stacked within bins. Can used create effect \"stacked\" dots ordering dots according discrete variable. omitted (NULL), value data points used determine stacking order. applies layout \"bin\" \"hex\", layout methods fully determine x y positions. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. justification: Justification interval relative slab, 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). justification NULL (default), set automatically based value side: side \"top\"/\"right\" justification set 0, side \"bottom\"/\"left\" justification set 1, side \"\" justification set 0.5. datatype: using composite geoms directly without stat (e.g. geom_slabinterval()), datatype used indicate part geom row data targets: rows datatype = \"slab\" target slab portion geometry rows datatype = \"interval\" target interval portion geometry. set automatically using ggdist stats. Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Point-specific aesthetics shape: Shape type used draw point sub-geometry. Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Slab-specific color line override aesthetics slab_fill: Override fill: fill color slab. slab_colour: (slab_color) Override colour/color: outline color slab. slab_alpha: Override alpha: opacity slab. slab_linewidth: Override linwidth: width outline slab. slab_linetype: Override linetype: line type outline slab. slab_shape: Override shape: shape dots used draw dotplot slab. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Point-specific color line override aesthetics point_fill: Override fill: fill color point. point_colour: (point_color) Override colour/color: outline color point. point_alpha: Override alpha: opacity point. point_size: Override size: size point. Deprecated aesthetics slab_size: Use slab_linewidth. interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"dotsinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_dotsinterval.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Automatic dotplot + point + interval meta-geom — geom_dotsinterval","text":"Kay, M., Kola, T., Hullman, J. R., & Munson, S. . (2016). (ish) Bus? User-centered Visualizations Uncertainty Everyday, Mobile Predictive Systems. Conference Human Factors Computing Systems - CHI '16, 5092--5103. doi:10.1145/2858036.2858558 . Fernandes, M., Walls, L., Munson, S., Hullman, J., & Kay, M. (2018). Uncertainty Displays Using Quantile Dotplots CDFs Improve Transit Decision-Making. Conference Human Factors Computing Systems - CHI '18. doi:10.1145/3173574.3173718 .","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/geom_dotsinterval.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Automatic dotplot + point + interval meta-geom — geom_dotsinterval","text":"Matthew Kay","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_dotsinterval.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Automatic dotplot + point + interval meta-geom — geom_dotsinterval","text":"","code":"library(dplyr) library(ggplot2)  theme_set(theme_ggdist())  set.seed(12345) df = tibble(   g = rep(c(\"a\", \"b\"), 200),   value = rnorm(400, c(0, 3), c(0.75, 1)) )   # orientation is detected automatically based on # which axis is discrete  df %>%   ggplot(aes(x = value, y = g)) +   geom_dotsinterval()   df %>%   ggplot(aes(y = value, x = g)) +   geom_dotsinterval()    # stat_dots can summarize quantiles, creating quantile dotplots  data(RankCorr_u_tau, package = \"ggdist\")  RankCorr_u_tau %>%   ggplot(aes(x = u_tau, y = factor(i))) +   stat_dots(quantiles = 100)   # color and fill aesthetics can be mapped within the geom # dotsinterval adds an interval  RankCorr_u_tau %>%   ggplot(aes(x = u_tau, y = factor(i), fill = after_stat(x > 6))) +   stat_dotsinterval(quantiles = 100)"},{"path":"http://mjskay.github.io/ggdist/reference/geom_interval.html","id":null,"dir":"Reference","previous_headings":"","what":"Multiple-interval plot (shortcut geom) — geom_interval","title":"Multiple-interval plot (shortcut geom) — geom_interval","text":"Shortcut version geom_slabinterval() creating multiple-interval plots. Roughly equivalent :","code":"geom_slabinterval(   aes(     datatype = \"interval\",     side = \"both\"   ),   interval_size_range = c(1, 6),   show_slab = FALSE,   show_point = FALSE )"},{"path":"http://mjskay.github.io/ggdist/reference/geom_interval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Multiple-interval plot (shortcut geom) — geom_interval","text":"","code":"geom_interval(   mapping = NULL,   data = NULL,   stat = \"identity\",   position = \"identity\",   ...,   orientation = NA,   interval_size_range = c(1, 6),   interval_size_domain = c(1, 6),   arrow = NULL,   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/geom_interval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Multiple-interval plot (shortcut geom) — geom_interval","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). stat statistical transformation use data layer, either ggproto Geom subclass string naming stat stripped stat_ prefix (e.g. \"count\" rather \"stat_count\") position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). interval_size_range length-2 numeric vector. geom scales raw size aesthetic values drawing interval point sizes, tend thick using default settings scale_size_continuous(), give sizes range c(1, 6). interval_size_domain value indicates input domain raw size values (typically equal value range argument scale_size_continuous() function), interval_size_range indicates desired output range size values (min max actual sizes used draw intervals). time recommended change value argument, may result strange scaling legends; argument holdover earlier versions size aesthetics targeting point interval separately. want adjust size interval points separately, can also use linewidth point_size aesthetics; see sub-geometry-scales. interval_size_domain length-2 numeric vector giving minimum maximum values size linewidth aesthetics translated actual sizes intervals drawn according interval_size_range (see documentation argument.) arrow grid::arrow() giving arrow heads use interval, NULL arrows. na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. can also named logical vector finely select aesthetics display. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_interval.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Multiple-interval plot (shortcut geom) — geom_interval","text":"ggplot2::Geom representing multiple-interval geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_interval.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Multiple-interval plot (shortcut geom) — geom_interval","text":"geom wraps geom_slabinterval() defaults designed produce multiple-interval plots. Default aesthetic mappings applied .width column present input data (e.g., generated point_interval() family functions), making geom often convenient vanilla ggplot2 geometries used functions like median_qi(), mean_qi(), mode_hdi(), etc. Specifically, .width present input, geom_interval() acts default aesthetics aes(colour = forcats::fct_rev(ordered(.width)))","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_interval.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Multiple-interval plot (shortcut geom) — geom_interval","text":"slab+interval stats geoms wide variety aesthetics control appearance three sub-geometries: slab, point, interval. Positional aesthetics x: x position geometry y: y position geometry Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Deprecated aesthetics interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"slabinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/geom_interval.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Multiple-interval plot (shortcut geom) — geom_interval","text":"","code":"library(dplyr) library(ggplot2)  theme_set(theme_ggdist())  data(RankCorr_u_tau, package = \"ggdist\")  # orientation is detected automatically based on # use of xmin/xmax or ymin/ymax  RankCorr_u_tau %>%   group_by(i) %>%   median_qi(.width = c(.5, .8, .95, .99)) %>%   ggplot(aes(y = i, x = u_tau, xmin = .lower, xmax = .upper)) +   geom_interval() +   scale_color_brewer()   RankCorr_u_tau %>%   group_by(i) %>%   median_qi(.width = c(.5, .8, .95, .99)) %>%   ggplot(aes(x = i, y = u_tau, ymin = .lower, ymax = .upper)) +   geom_interval() +   scale_color_brewer()"},{"path":"http://mjskay.github.io/ggdist/reference/geom_lineribbon.html","id":null,"dir":"Reference","previous_headings":"","what":"Line + multiple-ribbon plots (ggplot geom) — geom_lineribbon","title":"Line + multiple-ribbon plots (ggplot geom) — geom_lineribbon","text":"combination geom_line() geom_ribbon() default aesthetics designed use output point_interval().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_lineribbon.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Line + multiple-ribbon plots (ggplot geom) — geom_lineribbon","text":"","code":"geom_lineribbon(   mapping = NULL,   data = NULL,   stat = \"identity\",   position = \"identity\",   ...,   step = FALSE,   orientation = NA,   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/geom_lineribbon.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Line + multiple-ribbon plots (ggplot geom) — geom_lineribbon","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). stat statistical transformation use data layer, either ggproto Geom subclass string naming stat stripped stat_ prefix (e.g. \"count\" rather \"stat_count\") position Position adjustment, either string naming adjustment (e.g. \"jitter\" use position_jitter), result call position adjustment function. Use latter need change settings adjustment. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. step line/ribbon drawn step function? One : FALSE (default): draw step function. \"mid\" (TRUE): draw steps midway adjacent x values. \"hv\": draw horizontal--vertical steps. \"vh\": draw vertical--horizontal steps. TRUE alias \"mid\" step function ribbons, \"mid\" probably want (two step approaches ribbons either first last x value visible). orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. can also named logical vector finely select aesthetics display. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_lineribbon.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Line + multiple-ribbon plots (ggplot geom) — geom_lineribbon","text":"ggplot2::Geom representing combined line + multiple-ribbon geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_lineribbon.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Line + multiple-ribbon plots (ggplot geom) — geom_lineribbon","text":"geom_lineribbon() combination geom_line() geom_ribbon() designed use output point_interval(). geom sets default aesthetics equal .width column generated point_interval() family functions, making often convenient vanilla geom_ribbon() + geom_line(). Specifically, geom_lineribbon() acts default aesthetics aes(fill = forcats::fct_rev(ordered(.width))).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_lineribbon.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Line + multiple-ribbon plots (ggplot geom) — geom_lineribbon","text":"line+ribbon stats geoms wide variety aesthetics control appearance two sub-geometries: line ribbon. Positional aesthetics x: x position geometry y: y position geometry Ribbon-specific aesthetics xmin: Left edge ribbon sub-geometry (orientation = \"horizontal\"). xmax: Right edge ribbon sub-geometry (orientation = \"horizontal\"). ymin: Lower edge ribbon sub-geometry (orientation = \"vertical\"). ymax: Upper edge ribbon sub-geometry (orientation = \"vertical\"). order: order ribbons drawn. Ribbons smallest mean value order drawn first (.e., drawn ribbons larger mean values order). order supplied geom_lineribbon(), -abs(xmax - xmin) -abs(ymax - ymax) (depending orientation) used, effect drawing widest (average) ribbons bottom. stat_lineribbon() uses order = after_stat(level) default, causing ribbons generated largest .width drawn bottom. Color aesthetics colour: (color) color line sub-geometry. fill: fill color ribbon sub-geometry. alpha: opacity line ribbon sub-geometries. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line. ggplot2 < 3.4, called size. linetype: Type line (e.g., \"solid\", \"dashed\", etc) aesthetics (work standard geoms) group See examples aesthetics action vignette(\"lineribbon\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/geom_lineribbon.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Line + multiple-ribbon plots (ggplot geom) — geom_lineribbon","text":"Matthew Kay","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_lineribbon.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Line + multiple-ribbon plots (ggplot geom) — geom_lineribbon","text":"","code":"library(dplyr) library(ggplot2)  theme_set(theme_ggdist())  set.seed(12345) tibble(   x = rep(1:10, 100),   y = rnorm(1000, x) ) %>%   group_by(x) %>%   median_qi(.width = c(.5, .8, .95)) %>%   ggplot(aes(x = x, y = y, ymin = .lower, ymax = .upper)) +   # automatically uses aes(fill = forcats::fct_rev(ordered(.width)))   geom_lineribbon() +   scale_fill_brewer()"},{"path":"http://mjskay.github.io/ggdist/reference/geom_pointinterval.html","id":null,"dir":"Reference","previous_headings":"","what":"Point + multiple-interval plot (shortcut geom) — geom_pointinterval","title":"Point + multiple-interval plot (shortcut geom) — geom_pointinterval","text":"Shortcut version geom_slabinterval() creating point + multiple-interval plots. Roughly equivalent :","code":"geom_slabinterval(   aes(     datatype = \"interval\",     side = \"both\"   ),   show_slab = FALSE,   show.legend = c(size = FALSE) )"},{"path":"http://mjskay.github.io/ggdist/reference/geom_pointinterval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Point + multiple-interval plot (shortcut geom) — geom_pointinterval","text":"","code":"geom_pointinterval(   mapping = NULL,   data = NULL,   stat = \"identity\",   position = \"identity\",   ...,   orientation = NA,   interval_size_domain = c(1, 6),   interval_size_range = c(0.6, 1.4),   fatten_point = 1.8,   arrow = NULL,   na.rm = FALSE,   show.legend = c(size = FALSE),   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/geom_pointinterval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Point + multiple-interval plot (shortcut geom) — geom_pointinterval","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). stat statistical transformation use data layer, either ggproto Geom subclass string naming stat stripped stat_ prefix (e.g. \"count\" rather \"stat_count\") position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). interval_size_domain length-2 numeric vector giving minimum maximum values size linewidth aesthetics translated actual sizes intervals drawn according interval_size_range (see documentation argument.) interval_size_range length-2 numeric vector. geom scales raw size aesthetic values drawing interval point sizes, tend thick using default settings scale_size_continuous(), give sizes range c(1, 6). interval_size_domain value indicates input domain raw size values (typically equal value range argument scale_size_continuous() function), interval_size_range indicates desired output range size values (min max actual sizes used draw intervals). time recommended change value argument, may result strange scaling legends; argument holdover earlier versions size aesthetics targeting point interval separately. want adjust size interval points separately, can also use linewidth point_size aesthetics; see sub-geometry-scales. fatten_point multiplicative factor used adjust size point relative size thickest interval line. wish specify point sizes directly, can also use point_size aesthetic scale_point_size_continuous() scale_point_size_discrete(); sizes specified aesthetic adjusted using fatten_point. arrow grid::arrow() giving arrow heads use interval, NULL arrows. na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend layer included legends? Default c(size = FALSE), unlike geoms, match common use cases. FALSE hides legends, TRUE shows legends, NA shows mapped (default geoms). inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_pointinterval.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Point + multiple-interval plot (shortcut geom) — geom_pointinterval","text":"ggplot2::Geom representing point + multiple-interval geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_pointinterval.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Point + multiple-interval plot (shortcut geom) — geom_pointinterval","text":"geom wraps geom_slabinterval() defaults designed produce point + multiple-interval plots. Default aesthetic mappings applied .width column present input data (e.g., generated point_interval() family functions), making geom often convenient vanilla ggplot2 geometries used functions like median_qi(), mean_qi(), mode_hdi(), etc. Specifically, .width present input, geom_pointinterval() acts default aesthetics aes(size = -.width)","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_pointinterval.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Point + multiple-interval plot (shortcut geom) — geom_pointinterval","text":"slab+interval stats geoms wide variety aesthetics control appearance three sub-geometries: slab, point, interval. Positional aesthetics x: x position geometry y: y position geometry Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Point-specific aesthetics shape: Shape type used draw point sub-geometry. Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Point-specific color line override aesthetics point_fill: Override fill: fill color point. point_colour: (point_color) Override colour/color: outline color point. point_alpha: Override alpha: opacity point. point_size: Override size: size point. Deprecated aesthetics interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"slabinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/geom_pointinterval.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Point + multiple-interval plot (shortcut geom) — geom_pointinterval","text":"","code":"library(dplyr) library(ggplot2)  data(RankCorr_u_tau, package = \"ggdist\")  # orientation is detected automatically based on # use of xmin/xmax or ymin/ymax  RankCorr_u_tau %>%   group_by(i) %>%   median_qi(.width = c(.8, .95)) %>%   ggplot(aes(y = i, x = u_tau, xmin = .lower, xmax = .upper)) +   geom_pointinterval()   RankCorr_u_tau %>%   group_by(i) %>%   median_qi(.width = c(.8, .95)) %>%   ggplot(aes(x = i, y = u_tau, ymin = .lower, ymax = .upper)) +   geom_pointinterval()"},{"path":"http://mjskay.github.io/ggdist/reference/geom_slab.html","id":null,"dir":"Reference","previous_headings":"","what":"Slab (ridge) plot (shortcut geom) — geom_slab","title":"Slab (ridge) plot (shortcut geom) — geom_slab","text":"Shortcut version geom_slabinterval() creating slab (ridge) plots. Roughly equivalent :","code":"geom_slabinterval(   show_point = FALSE,   show_interval = FALSE )"},{"path":"http://mjskay.github.io/ggdist/reference/geom_slab.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Slab (ridge) plot (shortcut geom) — geom_slab","text":"","code":"geom_slab(   mapping = NULL,   data = NULL,   stat = \"identity\",   position = \"identity\",   ...,   orientation = NA,   normalize = \"all\",   fill_type = \"segments\",   subguide = \"none\",   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/geom_slab.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Slab (ridge) plot (shortcut geom) — geom_slab","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). stat statistical transformation use data layer, either ggproto Geom subclass string naming stat stripped stat_ prefix (e.g. \"count\" rather \"stat_count\") position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). normalize normalize heights functions input thickness aesthetic. One : \"\": normalize maximum height across data 1. \"panels\": normalize within panels maximum height panel 1. \"xy\": normalize within x/y axis opposite orientation geom maximum height value opposite axis 1. \"groups\": normalize within values opposite axis within group maximum height group 1. \"none\": values taken normalization (probably used functions whose values [0,1], CDFs). comprehensive discussion examples slab scaling normalization, see thickness scale article. fill_type type fill use fill color alpha varies within slab. One : \"segments\": breaks slab geometry segments unique combination fill color alpha value. approach supported graphics devices works well sharp cutoff values, can give ugly results large number unique fill colors used (gradients, like stat_gradientinterval()). \"gradient\": grid::linearGradient() used create smooth gradient fill. works well large numbers unique fill colors, requires R >= 4.1 yet supported graphics devices. writing, png() graphics device type = \"cairo\", svg() device, pdf() device, ragg::agg_png() devices known support option. R < 4.1, option fall back fill_type = \"segments\" message. \"auto\": attempts use fill_type = \"gradient\" support can auto-detected. R >= 4.2, support gradients can auto-detected graphics devices; support detected, option fall back fill_type = \"segments\" (case false negative, fill_type = \"gradient\" can set explicitly). R < 4.2, support gradients auto-detected, always fall back fill_type = \"segments\", case can set fill_type = \"gradient\" explicitly using graphics device support gradients. subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. can also named logical vector finely select aesthetics display. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_slab.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Slab (ridge) plot (shortcut geom) — geom_slab","text":"ggplot2::Geom representing slab (ridge) geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_slab.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Slab (ridge) plot (shortcut geom) — geom_slab","text":"slab+interval stats geoms wide variety aesthetics control appearance three sub-geometries: slab, point, interval. Positional aesthetics x: x position geometry y: y position geometry Slab-specific aesthetics thickness: thickness slab x value (orientation = \"horizontal\") y value (orientation = \"vertical\") slab. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. justification: Justification interval relative slab, 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). justification NULL (default), set automatically based value side: side \"top\"/\"right\" justification set 0, side \"bottom\"/\"left\" justification set 1, side \"\" justification set 0.5. Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Slab-specific color line override aesthetics slab_fill: Override fill: fill color slab. slab_colour: (slab_color) Override colour/color: outline color slab. slab_alpha: Override alpha: opacity slab. slab_linewidth: Override linwidth: width outline slab. slab_linetype: Override linetype: line type outline slab. Deprecated aesthetics slab_size: Use slab_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"slabinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/geom_slab.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Slab (ridge) plot (shortcut geom) — geom_slab","text":"","code":"library(dplyr) library(ggplot2)  theme_set(theme_ggdist())  # we will manually demonstrate plotting a density with geom_slab(), # though generally speaking this is easier to do using stat_slab(), which # will determine sensible limits automatically and correctly adjust # densities when using scale transformations df = expand.grid(     mean = 1:3,     input = seq(-2, 6, length.out = 100)   ) %>%   mutate(     group = letters[4 - mean],     density = dnorm(input, mean, 1)   )  # orientation is detected automatically based on # use of x or y df %>%   ggplot(aes(y = group, x = input, thickness = density)) +   geom_slab()   df %>%   ggplot(aes(x = group, y = input, thickness = density)) +   geom_slab()   # RIDGE PLOTS # \"ridge\" plots can be created by increasing the slab height and # setting the slab color df %>%   ggplot(aes(y = group, x = input, thickness = density)) +   geom_slab(height = 2, color = \"black\")"},{"path":"http://mjskay.github.io/ggdist/reference/geom_slabinterval.html","id":null,"dir":"Reference","previous_headings":"","what":"Slab + point + interval meta-geom — geom_slabinterval","title":"Slab + point + interval meta-geom — geom_slabinterval","text":"meta-geom supports drawing combinations functions (slabs, aka ridge plots joy plots), points, intervals. acts meta-geom many ggdist geoms wrappers around geom, including eye plots, half-eye plots, CCDF barplots, point+multiple interval plots, supports horizontal vertical orientations, dodging (via position argument), relative justification slabs corresponding intervals.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_slabinterval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Slab + point + interval meta-geom — geom_slabinterval","text":"","code":"geom_slabinterval(   mapping = NULL,   data = NULL,   stat = \"identity\",   position = \"identity\",   ...,   orientation = NA,   normalize = \"all\",   fill_type = \"segments\",   interval_size_domain = c(1, 6),   interval_size_range = c(0.6, 1.4),   fatten_point = 1.8,   arrow = NULL,   show_slab = TRUE,   show_point = TRUE,   show_interval = TRUE,   subguide = \"none\",   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/geom_slabinterval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Slab + point + interval meta-geom — geom_slabinterval","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). stat statistical transformation use data layer, either ggproto Geom subclass string naming stat stripped stat_ prefix (e.g. \"count\" rather \"stat_count\") position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). normalize normalize heights functions input thickness aesthetic. One : \"\": normalize maximum height across data 1. \"panels\": normalize within panels maximum height panel 1. \"xy\": normalize within x/y axis opposite orientation geom maximum height value opposite axis 1. \"groups\": normalize within values opposite axis within group maximum height group 1. \"none\": values taken normalization (probably used functions whose values [0,1], CDFs). comprehensive discussion examples slab scaling normalization, see thickness scale article. fill_type type fill use fill color alpha varies within slab. One : \"segments\": breaks slab geometry segments unique combination fill color alpha value. approach supported graphics devices works well sharp cutoff values, can give ugly results large number unique fill colors used (gradients, like stat_gradientinterval()). \"gradient\": grid::linearGradient() used create smooth gradient fill. works well large numbers unique fill colors, requires R >= 4.1 yet supported graphics devices. writing, png() graphics device type = \"cairo\", svg() device, pdf() device, ragg::agg_png() devices known support option. R < 4.1, option fall back fill_type = \"segments\" message. \"auto\": attempts use fill_type = \"gradient\" support can auto-detected. R >= 4.2, support gradients can auto-detected graphics devices; support detected, option fall back fill_type = \"segments\" (case false negative, fill_type = \"gradient\" can set explicitly). R < 4.2, support gradients auto-detected, always fall back fill_type = \"segments\", case can set fill_type = \"gradient\" explicitly using graphics device support gradients. interval_size_domain length-2 numeric vector giving minimum maximum values size linewidth aesthetics translated actual sizes intervals drawn according interval_size_range (see documentation argument.) interval_size_range length-2 numeric vector. geom scales raw size aesthetic values drawing interval point sizes, tend thick using default settings scale_size_continuous(), give sizes range c(1, 6). interval_size_domain value indicates input domain raw size values (typically equal value range argument scale_size_continuous() function), interval_size_range indicates desired output range size values (min max actual sizes used draw intervals). time recommended change value argument, may result strange scaling legends; argument holdover earlier versions size aesthetics targeting point interval separately. want adjust size interval points separately, can also use linewidth point_size aesthetics; see sub-geometry-scales. fatten_point multiplicative factor used adjust size point relative size thickest interval line. wish specify point sizes directly, can also use point_size aesthetic scale_point_size_continuous() scale_point_size_discrete(); sizes specified aesthetic adjusted using fatten_point. arrow grid::arrow() giving arrow heads use interval, NULL arrows. show_slab slab portion geom drawn? show_point point portion geom drawn? show_interval interval portion geom drawn? subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. can also named logical vector finely select aesthetics display. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_slabinterval.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Slab + point + interval meta-geom — geom_slabinterval","text":"ggplot2::Geom representing slab combined slab+interval geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_slabinterval.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Slab + point + interval meta-geom — geom_slabinterval","text":"geom_slabinterval() flexible meta-geom can use directly variety \"shortcut\" geoms represent useful combinations various parameters geom. many cases want use shortcut geoms instead create useful mnemonic primitives, eye plots, half-eye plots, point+interval plots, CCDF barplots. slab portion geom much like ridge \"joy\" plot: represents value function scaled fit values x y axis (depending value orientation). Values functions specified using thickness aesthetic scaled fit scale times distance points relevant axis. E.g., orientation \"horizontal\", scale 0.9, y discrete variable, thickness aesthetic specifies value function x drawn every y value scaled fit 0.9 times distance points y axis. interval portion geom, x y aesthetics specify location point, ymin/ymax xmin/xmax (depending value orientation) specify endpoints interval. scaling factor interval line width point size applied interval_size_domain, interval_size_range, fatten_point parameters. scaling factors designed give multiple uncertainty intervals reasonable scaling default settings scale_size_continuous(). combination geom, geom expects datatype aesthetic specifying part geom given row input data corresponds : \"slab\" \"interval\". However, specifying aesthetic manually typically necessary use geom directly; numerous wrapper geoms usually set aesthetic needed, use recommended unless custom use case. Wrapper geoms include: geom_pointinterval() geom_interval() geom_slab() addition, stat_slabinterval() family stats uses geoms geom_slabinterval() family, often easier use using geoms directly. Typically, geom_* versions meant use already-summarized data (intervals) stat_* versions summarize data (usually draws distribution) produce geom.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_slabinterval.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Slab + point + interval meta-geom — geom_slabinterval","text":"slab+interval stats geoms wide variety aesthetics control appearance three sub-geometries: slab, point, interval. Positional aesthetics x: x position geometry y: y position geometry Slab-specific aesthetics thickness: thickness slab x value (orientation = \"horizontal\") y value (orientation = \"vertical\") slab. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. justification: Justification interval relative slab, 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). justification NULL (default), set automatically based value side: side \"top\"/\"right\" justification set 0, side \"bottom\"/\"left\" justification set 1, side \"\" justification set 0.5. datatype: using composite geoms directly without stat (e.g. geom_slabinterval()), datatype used indicate part geom row data targets: rows datatype = \"slab\" target slab portion geometry rows datatype = \"interval\" target interval portion geometry. set automatically using ggdist stats. Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Point-specific aesthetics shape: Shape type used draw point sub-geometry. Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Slab-specific color line override aesthetics slab_fill: Override fill: fill color slab. slab_colour: (slab_color) Override colour/color: outline color slab. slab_alpha: Override alpha: opacity slab. slab_linewidth: Override linwidth: width outline slab. slab_linetype: Override linetype: line type outline slab. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Point-specific color line override aesthetics point_fill: Override fill: fill color point. point_colour: (point_color) Override colour/color: outline color point. point_alpha: Override alpha: opacity point. point_size: Override size: size point. Deprecated aesthetics slab_size: Use slab_linewidth. interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"slabinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/geom_slabinterval.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Slab + point + interval meta-geom — geom_slabinterval","text":"Matthew Kay","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_slabinterval.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Slab + point + interval meta-geom — geom_slabinterval","text":"","code":"# geom_slabinterval() is typically not that useful on its own. # See vignette(\"slabinterval\") for a variety of examples of the use of its # shortcut geoms and stats, which are more useful than using # geom_slabinterval() directly."},{"path":"http://mjskay.github.io/ggdist/reference/geom_spike.html","id":null,"dir":"Reference","previous_headings":"","what":"Spike plot (ggplot2 geom) — geom_spike","title":"Spike plot (ggplot2 geom) — geom_spike","text":"Geometry drawing \"spikes\" (optionally points ) top geom_slabinterval() geometries: geometry understands scaling positioning thickness aesthetic geom_slabinterval(), allows position spikes points along slab.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_spike.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spike plot (ggplot2 geom) — geom_spike","text":"","code":"geom_spike(   mapping = NULL,   data = NULL,   stat = \"identity\",   position = \"identity\",   ...,   orientation = NA,   normalize = \"all\",   arrow = NULL,   subguide = \"none\",   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/geom_spike.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Spike plot (ggplot2 geom) — geom_spike","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). stat statistical transformation use data layer, either ggproto Geom subclass string naming stat stripped stat_ prefix (e.g. \"count\" rather \"stat_count\") position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). normalize normalize heights functions input thickness aesthetic. One : \"\": normalize maximum height across data 1. \"panels\": normalize within panels maximum height panel 1. \"xy\": normalize within x/y axis opposite orientation geom maximum height value opposite axis 1. \"groups\": normalize within values opposite axis within group maximum height group 1. \"none\": values taken normalization (probably used functions whose values [0,1], CDFs). comprehensive discussion examples slab scaling normalization, see thickness scale article. arrow grid::arrow() giving arrow heads use spike, NULL arrows. subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. can also named logical vector finely select aesthetics display. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_spike.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Spike plot (ggplot2 geom) — geom_spike","text":"ggplot2::Geom representing spike geometry can added ggplot() object. rd_slabinterval_aesthetics(geom_name),","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_spike.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Spike plot (ggplot2 geom) — geom_spike","text":"geometry consists \"spike\" (vertical/horizontal line segment) \"point\" (end line segment). uses thickness aesthetic determine endpoint line , allows used geom_slabinterval() geometries labeling specific values thickness function.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_spike.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Spike plot (ggplot2 geom) — geom_spike","text":"spike geom wide variety aesthetics control appearance two sub-geometries: spike point. Positional aesthetics x: x position geometry y: y position geometry Spike-specific (aka Slab-specific) aesthetics thickness: thickness slab x value (orientation = \"horizontal\") y value (orientation = \"vertical\") slab. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. Color aesthetics colour: (color) color spike point sub-geometries. fill: fill color point sub-geometry. alpha: opacity spike point sub-geometries. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw spike sub-geometry. size: Size point sub-geometry. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw spike. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"slabinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/geom_spike.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Spike plot (ggplot2 geom) — geom_spike","text":"","code":"library(ggplot2) library(distributional) library(dplyr)  # geom_spike is easiest to use with distributional or # posterior::rvar objects df = tibble(   d = dist_normal(1:2, 1:2), g = c(\"a\", \"b\") )  # annotate the density at the mean of a distribution df %>% mutate(   mean = mean(d),   density(d, list(density_at_mean = mean)) ) %>%   ggplot(aes(y = g)) +   stat_slab(aes(xdist = d)) +   geom_spike(aes(x = mean, thickness = density_at_mean)) +   # need shared thickness scale so that stat_slab and geom_spike line up   scale_thickness_shared()   # annotate the endpoints of intervals of a distribution # here we'll use an arrow instead of a point by setting size = 0 arrow_spec = arrow(angle = 45, type = \"closed\", length = unit(4, \"pt\")) df %>% mutate(   median_qi(d, .width = 0.9),   density(d, list(density_lower = .lower, density_upper = .upper)) ) %>%   ggplot(aes(y = g)) +   stat_halfeye(aes(xdist = d), .width = 0.9, color = \"gray35\") +   geom_spike(     aes(x = .lower, thickness = density_lower),     size = 0, arrow = arrow_spec, color = \"blue\", linewidth = 0.75   ) +   geom_spike(     aes(x = .upper, thickness = density_upper),     size = 0, arrow = arrow_spec, color = \"red\", linewidth = 0.75   ) +   scale_thickness_shared()"},{"path":"http://mjskay.github.io/ggdist/reference/geom_swarm.html","id":null,"dir":"Reference","previous_headings":"","what":"Beeswarm plot (shortcut geom) — geom_swarm","title":"Beeswarm plot (shortcut geom) — geom_swarm","text":"Shortcut version geom_dotsinterval() creating beeswarm plots. Geoms based geom_dotsinterval() create dotplots automatically ensure plot fits within available space. Roughly equivalent :","code":"geom_dots(   aes(side = \"both\"),   overflow = \"compress\",   binwidth = unit(1.5, \"mm\"),   layout = \"swarm\" )"},{"path":"http://mjskay.github.io/ggdist/reference/geom_swarm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Beeswarm plot (shortcut geom) — geom_swarm","text":"","code":"geom_swarm(   mapping = NULL,   data = NULL,   stat = \"identity\",   position = \"identity\",   ...,   overflow = \"compress\",   binwidth = unit(1.5, \"mm\"),   layout = \"swarm\",   dotsize = 1.07,   stackratio = 1,   overlaps = \"nudge\",   smooth = \"none\",   verbose = FALSE,   orientation = NA,   subguide = \"none\",   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/geom_swarm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Beeswarm plot (shortcut geom) — geom_swarm","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). stat statistical transformation use data layer, either ggproto Geom subclass string naming stat stripped stat_ prefix (e.g. \"count\" rather \"stat_count\") position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. overflow handle overflow dots beyond extent geom minimum binwidth (exact binwidth) supplied. One : \"keep\": Keep overflow, drawing dots outside geom bounds. \"warn\": Keep overflow, produce warning suggesting solutions, setting binwidth = NA overflow = \"compress\". \"compress\": Compress layout. Reduces binwidth size necessary keep dots within bounds, adjusts stackratio dotsize apparent dot size user-specified minimum binwidth times user-specified dotsize. find default layout dots small, okay dots overlapping, consider setting overflow = \"compress\" supplying exact minimum dot size using binwidth. binwidth bin width use laying dots. One : NA (default): Dynamically select bin width based size plot drawn. pick binwidth tallest stack dots scale height (ideally exactly scale height, though guaranteed). length-1 (scalar) numeric unit object giving exact bin width. length-2 (vector) numeric unit object giving minimum maximum desired bin width. bin width dynamically selected within bounds. value numeric, assumed units data. bin width (bounds) can also specified using unit(), may useful desired dots certain point size certain percentage width/height viewport. example, unit(0.1, \"npc\") make dots exactly 10% viewport size along whichever dimension dotplot drawn; unit(c(0, 0.1), \"npc\") make dots 10% viewport size (still ensuring tallest stack less equal scale). layout layout method used dots: \"bin\" (default): places dots -axis midpoint bins classic Wilkinson dotplot. maintains alignment rows columns dotplot. layout slightly different classic Wilkinson algorithm : (1) nudges bins slightly avoid overlapping bins (2) input data symmetrical return symmetrical layout. \"weave\": uses basic binning approach \"bin\", places dots -axis actual positions (unless overlaps = \"nudge\", case overlaps may nudged way). maintains alignment rows align dots within columns. \"hex\": uses basic binning approach \"bin\", alternates placing dots + binwidth/4 - binwidth/4 -axis bin center. allows hexagonal packing setting stackratio less 1 (something like 0.9 tends work). \"swarm\": uses \"compactswarm\" layout beeswarm::beeswarm(). maintain alignment rows columns, can compact neat looking, especially sample data (opposed quantile dotplots theoretical distributions, may look better \"bin\", \"weave\", \"hex\"). \"bar\": discrete distributions, lays duplicate values rectangular bars. dotsize width dots relative binwidth. default, 1.07, makes dots just bit wider bin width, manually-tuned parameter tends work well default circular shape, preventing gaps bins appearing large visually (might arise dots precisely binwidth). desired dots precisely binwidth, set dotsize = 1. stackratio distance center dots stack relative dot height. default, 1, makes dots stack just touch . overlaps handle overlapping dots bins \"bin\", \"weave\", \"hex\" layouts (dots never overlap \"swarm\" \"bar\" layouts). purposes argument, dots considered overlapping overlapping dotsize = 1 stackratio = 1; .e. set arguments values, overlaps may still occur. One : \"keep\": leave overlapping dots . Dots may overlap (usually slightly) \"bin\", \"weave\", \"hex\" layouts. \"nudge\": nudge overlapping dots way. Overlaps avoided using constrained optimization minimizes squared distance dots desired positions, subject constraint adjacent dots overlap. smooth Smoother apply dot positions. One : function takes numeric vector dot positions returns smoothed version vector, smooth_bounded(), smooth_unbounded(), smooth_discrete(), smooth_bar()`. string indicating smoother use, suffix function name starting smooth_; e.g. \"none\" (default) applies smooth_none(), simply returns given vector without applying smoothing. Smoothing effective smoother matched support distribution; e.g. using smooth_bounded(bounds = ...). verbose TRUE, print bin width dotplot. Can useful want start automatically-selected bin width adjust manually. Bin width printed data units normalized parent coordinates \"npc\"s (see unit()). Note just want scale selected bin width fit within desired area, probably easier use scale copy scale binwidth manually, just want provide constraints bin width, can pass length-2 vector binwidth. orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. can also named logical vector finely select aesthetics display. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_swarm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Beeswarm plot (shortcut geom) — geom_swarm","text":"ggplot2::Geom representing beeswarm geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_swarm.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Beeswarm plot (shortcut geom) — geom_swarm","text":"dots family stats geoms similar geom_dotplot() number differences: Dots geoms act like slabs geom_slabinterval() can given x positions (y positions horizontal orientation). Given available space lay dots, dots geoms automatically determine many bins use fit available space. Dots geoms use dynamic layout algorithm lays dots center input data symmetrical, guaranteeing symmetrical data results symmetrical plot. layout algorithm also prevents dots overlapping . shape dots geoms can changed using slab_shape aesthetic (using dotsinterval family) shape slab_shape aesthetic (using dots family) Stats geoms family include: geom_dots(): dotplots raw data. Ensures dotplot fits within available space reducing size dots automatically (may result small dots). geom_swarm() geom_weave(): dotplots raw data defaults intended create \"beeswarm\" plots. Used side = \"\" default, sets default dot size size geom_point() (binwidth = unit(1.5, \"mm\")), allowing dots overlap instead getting small. stat_dots(): dotplots raw data, distributional objects, posterior::rvar()s geom_dotsinterval(): dotplot + interval plots raw data already-calculated intervals (rarely useful directly). stat_dotsinterval(): dotplot + interval plots raw data, distributional objects, posterior::rvar()s (calculate intervals ). geom_blur_dots(): blurry dotplots allow standard deviation blur applied dot specified using sd aesthetic. stat_mcse_dots(): blurry dotplots quantiles using Monte Carlo Standard Error quantile. stat_dots() stat_dotsinterval(), used quantiles argument, particularly useful constructing quantile dotplots, can effective way communicate uncertainty using frequency framing may easier laypeople understand (Kay et al. 2016, Fernandes et al. 2018).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_swarm.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Beeswarm plot (shortcut geom) — geom_swarm","text":"dots+interval stats geoms wide variety aesthetics control appearance three sub-geometries: dots (aka slab), point, interval. Positional aesthetics x: x position geometry y: y position geometry Dots-specific (aka Slab-specific) aesthetics family: font family used draw dots. order: order data points stacked within bins. Can used create effect \"stacked\" dots ordering dots according discrete variable. omitted (NULL), value data points used determine stacking order. applies layout \"bin\" \"hex\", layout methods fully determine x y positions. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. justification: Justification interval relative slab, 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). justification NULL (default), set automatically based value side: side \"top\"/\"right\" justification set 0, side \"bottom\"/\"left\" justification set 1, side \"\" justification set 0.5. datatype: using composite geoms directly without stat (e.g. geom_slabinterval()), datatype used indicate part geom row data targets: rows datatype = \"slab\" target slab portion geometry rows datatype = \"interval\" target interval portion geometry. set automatically using ggdist stats. Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Point-specific aesthetics shape: Shape type used draw point sub-geometry. Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Slab-specific color line override aesthetics slab_fill: Override fill: fill color slab. slab_colour: (slab_color) Override colour/color: outline color slab. slab_alpha: Override alpha: opacity slab. slab_linewidth: Override linwidth: width outline slab. slab_linetype: Override linetype: line type outline slab. slab_shape: Override shape: shape dots used draw dotplot slab. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Point-specific color line override aesthetics point_fill: Override fill: fill color point. point_colour: (point_color) Override colour/color: outline color point. point_alpha: Override alpha: opacity point. point_size: Override size: size point. Deprecated aesthetics slab_size: Use slab_linewidth. interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"dotsinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_swarm.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Beeswarm plot (shortcut geom) — geom_swarm","text":"Kay, M., Kola, T., Hullman, J. R., & Munson, S. . (2016). (ish) Bus? User-centered Visualizations Uncertainty Everyday, Mobile Predictive Systems. Conference Human Factors Computing Systems - CHI '16, 5092--5103. doi:10.1145/2858036.2858558 . Fernandes, M., Walls, L., Munson, S., Hullman, J., & Kay, M. (2018). Uncertainty Displays Using Quantile Dotplots CDFs Improve Transit Decision-Making. Conference Human Factors Computing Systems - CHI '18. doi:10.1145/3173574.3173718 .","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/geom_swarm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Beeswarm plot (shortcut geom) — geom_swarm","text":"","code":"library(dplyr) library(ggplot2)  theme_set(theme_ggdist())  set.seed(12345) df = tibble(   g = rep(c(\"a\", \"b\"), 200),   value = rnorm(400, c(0, 3), c(0.75, 1)) )  # orientation is detected automatically based on # which axis is discrete  df %>%   ggplot(aes(x = value, y = g)) +   geom_swarm()   df %>%   ggplot(aes(y = value, x = g)) +   geom_swarm()"},{"path":"http://mjskay.github.io/ggdist/reference/geom_weave.html","id":null,"dir":"Reference","previous_headings":"","what":"Dot-weave plot (shortcut geom) — geom_weave","title":"Dot-weave plot (shortcut geom) — geom_weave","text":"Shortcut version geom_dotsinterval() creating dot-weave plots. Geoms based geom_dotsinterval() create dotplots automatically ensure plot fits within available space. Roughly equivalent :","code":"geom_dots(   aes(side = \"both\"),   layout = \"weave\",   overflow = \"compress\",   binwidth = unit(1.5, \"mm\") )"},{"path":"http://mjskay.github.io/ggdist/reference/geom_weave.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dot-weave plot (shortcut geom) — geom_weave","text":"","code":"geom_weave(   mapping = NULL,   data = NULL,   stat = \"identity\",   position = \"identity\",   ...,   layout = \"weave\",   overflow = \"compress\",   binwidth = unit(1.5, \"mm\"),   dotsize = 1.07,   stackratio = 1,   overlaps = \"nudge\",   smooth = \"none\",   verbose = FALSE,   orientation = NA,   subguide = \"none\",   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/geom_weave.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dot-weave plot (shortcut geom) — geom_weave","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). stat statistical transformation use data layer, either ggproto Geom subclass string naming stat stripped stat_ prefix (e.g. \"count\" rather \"stat_count\") position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. layout layout method used dots: \"bin\" (default): places dots -axis midpoint bins classic Wilkinson dotplot. maintains alignment rows columns dotplot. layout slightly different classic Wilkinson algorithm : (1) nudges bins slightly avoid overlapping bins (2) input data symmetrical return symmetrical layout. \"weave\": uses basic binning approach \"bin\", places dots -axis actual positions (unless overlaps = \"nudge\", case overlaps may nudged way). maintains alignment rows align dots within columns. \"hex\": uses basic binning approach \"bin\", alternates placing dots + binwidth/4 - binwidth/4 -axis bin center. allows hexagonal packing setting stackratio less 1 (something like 0.9 tends work). \"swarm\": uses \"compactswarm\" layout beeswarm::beeswarm(). maintain alignment rows columns, can compact neat looking, especially sample data (opposed quantile dotplots theoretical distributions, may look better \"bin\", \"weave\", \"hex\"). \"bar\": discrete distributions, lays duplicate values rectangular bars. overflow handle overflow dots beyond extent geom minimum binwidth (exact binwidth) supplied. One : \"keep\": Keep overflow, drawing dots outside geom bounds. \"warn\": Keep overflow, produce warning suggesting solutions, setting binwidth = NA overflow = \"compress\". \"compress\": Compress layout. Reduces binwidth size necessary keep dots within bounds, adjusts stackratio dotsize apparent dot size user-specified minimum binwidth times user-specified dotsize. find default layout dots small, okay dots overlapping, consider setting overflow = \"compress\" supplying exact minimum dot size using binwidth. binwidth bin width use laying dots. One : NA (default): Dynamically select bin width based size plot drawn. pick binwidth tallest stack dots scale height (ideally exactly scale height, though guaranteed). length-1 (scalar) numeric unit object giving exact bin width. length-2 (vector) numeric unit object giving minimum maximum desired bin width. bin width dynamically selected within bounds. value numeric, assumed units data. bin width (bounds) can also specified using unit(), may useful desired dots certain point size certain percentage width/height viewport. example, unit(0.1, \"npc\") make dots exactly 10% viewport size along whichever dimension dotplot drawn; unit(c(0, 0.1), \"npc\") make dots 10% viewport size (still ensuring tallest stack less equal scale). dotsize width dots relative binwidth. default, 1.07, makes dots just bit wider bin width, manually-tuned parameter tends work well default circular shape, preventing gaps bins appearing large visually (might arise dots precisely binwidth). desired dots precisely binwidth, set dotsize = 1. stackratio distance center dots stack relative dot height. default, 1, makes dots stack just touch . overlaps handle overlapping dots bins \"bin\", \"weave\", \"hex\" layouts (dots never overlap \"swarm\" \"bar\" layouts). purposes argument, dots considered overlapping overlapping dotsize = 1 stackratio = 1; .e. set arguments values, overlaps may still occur. One : \"keep\": leave overlapping dots . Dots may overlap (usually slightly) \"bin\", \"weave\", \"hex\" layouts. \"nudge\": nudge overlapping dots way. Overlaps avoided using constrained optimization minimizes squared distance dots desired positions, subject constraint adjacent dots overlap. smooth Smoother apply dot positions. One : function takes numeric vector dot positions returns smoothed version vector, smooth_bounded(), smooth_unbounded(), smooth_discrete(), smooth_bar()`. string indicating smoother use, suffix function name starting smooth_; e.g. \"none\" (default) applies smooth_none(), simply returns given vector without applying smoothing. Smoothing effective smoother matched support distribution; e.g. using smooth_bounded(bounds = ...). verbose TRUE, print bin width dotplot. Can useful want start automatically-selected bin width adjust manually. Bin width printed data units normalized parent coordinates \"npc\"s (see unit()). Note just want scale selected bin width fit within desired area, probably easier use scale copy scale binwidth manually, just want provide constraints bin width, can pass length-2 vector binwidth. orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. can also named logical vector finely select aesthetics display. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_weave.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Dot-weave plot (shortcut geom) — geom_weave","text":"ggplot2::Geom representing dot-weave geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_weave.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Dot-weave plot (shortcut geom) — geom_weave","text":"dots family stats geoms similar geom_dotplot() number differences: Dots geoms act like slabs geom_slabinterval() can given x positions (y positions horizontal orientation). Given available space lay dots, dots geoms automatically determine many bins use fit available space. Dots geoms use dynamic layout algorithm lays dots center input data symmetrical, guaranteeing symmetrical data results symmetrical plot. layout algorithm also prevents dots overlapping . shape dots geoms can changed using slab_shape aesthetic (using dotsinterval family) shape slab_shape aesthetic (using dots family) Stats geoms family include: geom_dots(): dotplots raw data. Ensures dotplot fits within available space reducing size dots automatically (may result small dots). geom_swarm() geom_weave(): dotplots raw data defaults intended create \"beeswarm\" plots. Used side = \"\" default, sets default dot size size geom_point() (binwidth = unit(1.5, \"mm\")), allowing dots overlap instead getting small. stat_dots(): dotplots raw data, distributional objects, posterior::rvar()s geom_dotsinterval(): dotplot + interval plots raw data already-calculated intervals (rarely useful directly). stat_dotsinterval(): dotplot + interval plots raw data, distributional objects, posterior::rvar()s (calculate intervals ). geom_blur_dots(): blurry dotplots allow standard deviation blur applied dot specified using sd aesthetic. stat_mcse_dots(): blurry dotplots quantiles using Monte Carlo Standard Error quantile. stat_dots() stat_dotsinterval(), used quantiles argument, particularly useful constructing quantile dotplots, can effective way communicate uncertainty using frequency framing may easier laypeople understand (Kay et al. 2016, Fernandes et al. 2018).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_weave.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Dot-weave plot (shortcut geom) — geom_weave","text":"dots+interval stats geoms wide variety aesthetics control appearance three sub-geometries: dots (aka slab), point, interval. Positional aesthetics x: x position geometry y: y position geometry Dots-specific (aka Slab-specific) aesthetics family: font family used draw dots. order: order data points stacked within bins. Can used create effect \"stacked\" dots ordering dots according discrete variable. omitted (NULL), value data points used determine stacking order. applies layout \"bin\" \"hex\", layout methods fully determine x y positions. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. justification: Justification interval relative slab, 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). justification NULL (default), set automatically based value side: side \"top\"/\"right\" justification set 0, side \"bottom\"/\"left\" justification set 1, side \"\" justification set 0.5. datatype: using composite geoms directly without stat (e.g. geom_slabinterval()), datatype used indicate part geom row data targets: rows datatype = \"slab\" target slab portion geometry rows datatype = \"interval\" target interval portion geometry. set automatically using ggdist stats. Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Point-specific aesthetics shape: Shape type used draw point sub-geometry. Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Slab-specific color line override aesthetics slab_fill: Override fill: fill color slab. slab_colour: (slab_color) Override colour/color: outline color slab. slab_alpha: Override alpha: opacity slab. slab_linewidth: Override linwidth: width outline slab. slab_linetype: Override linetype: line type outline slab. slab_shape: Override shape: shape dots used draw dotplot slab. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Point-specific color line override aesthetics point_fill: Override fill: fill color point. point_colour: (point_color) Override colour/color: outline color point. point_alpha: Override alpha: opacity point. point_size: Override size: size point. Deprecated aesthetics slab_size: Use slab_linewidth. interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"dotsinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":"http://mjskay.github.io/ggdist/reference/geom_weave.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Dot-weave plot (shortcut geom) — geom_weave","text":"Kay, M., Kola, T., Hullman, J. R., & Munson, S. . (2016). (ish) Bus? User-centered Visualizations Uncertainty Everyday, Mobile Predictive Systems. Conference Human Factors Computing Systems - CHI '16, 5092--5103. doi:10.1145/2858036.2858558 . Fernandes, M., Walls, L., Munson, S., Hullman, J., & Kay, M. (2018). Uncertainty Displays Using Quantile Dotplots CDFs Improve Transit Decision-Making. Conference Human Factors Computing Systems - CHI '18. doi:10.1145/3173574.3173718 .","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/geom_weave.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Dot-weave plot (shortcut geom) — geom_weave","text":"","code":"library(dplyr) library(ggplot2)  theme_set(theme_ggdist())  set.seed(12345) df = tibble(   g = rep(c(\"a\", \"b\"), 200),   value = rnorm(400, c(0, 3), c(0.75, 1)) )  # orientation is detected automatically based on # which axis is discrete  df %>%   ggplot(aes(x = value, y = g)) +   geom_weave()   df %>%   ggplot(aes(y = value, x = g)) +   geom_weave()"},{"path":"http://mjskay.github.io/ggdist/reference/ggdist-deprecated.html","id":null,"dir":"Reference","previous_headings":"","what":"Deprecated functions and arguments in ggdist — ggdist-deprecated","title":"Deprecated functions and arguments in ggdist — ggdist-deprecated","text":"Deprecated functions arguments alternatives listed .","code":""},{"path":"http://mjskay.github.io/ggdist/reference/ggdist-deprecated.html","id":"deprecated-stats-and-geoms","dir":"Reference","previous_headings":"","what":"Deprecated stats and geoms","title":"Deprecated functions and arguments in ggdist — ggdist-deprecated","text":"stat_sample_... stat_dist_... families stats merged ggdist 3.1. means: stat_dist_... deprecated. code using stat_dist_XXX(), now able use stat_XXX() instead without additional modifications almost cases. stat_sample_slabinterval() deprecated. able use stat_slabinterval() instead without additional modifications almost cases. old stat_dist_... names currently kept aliases, may removed future.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/ggdist-deprecated.html","id":"deprecated-arguments","dir":"Reference","previous_headings":"","what":"Deprecated arguments","title":"Deprecated functions and arguments in ggdist — ggdist-deprecated","text":"Parameters stat_slabinterval() family deprecated ggdist 3.1 : .prob argument, long-deprecated alias .width, removed ggdist 3.1. limits_function argument: parameter determining function compute limits slab stat_slabinterval() derived stats. function really internal function needed subclasses base class, yet added lot noise documentation, replaced AbstractStatSlabInterval$compute_limits(). limits_args argument: extra stat parameters now passed ... arguments AbstractStatSlabInterval$compute_limits(); use instead. slab_function argument: parameter determining function compute slabs stat_slabinterval() derived stats. function really internal function needed subclasses base class, yet added lot noise documentation, replaced AbstractStatSlabInterval$compute_slab(). slab_args argument: extra stat parameters now passed ... arguments AbstractStatSlabInterval$compute_slab(); use instead. interval_function fun.data arguments: parameters determining function compute intervals stat_slabinterval() derived stats. function really internal function needed subclasses base class, yet added lot noise documentation, replaced AbstractStatSlabInterval$compute_interval(). interval_args fun.args arguments: pass extra arguments point_interval replace value point_interval argument simple wrapper; e.g. stat_halfeye(point_interval = \\(...) point_interval(..., extra_arg = XXX)) Parameters geom_slabinterval() family deprecated ggdist 3.1 : size_domain size_range arguments, long-deprecated aliases interval_size_domain interval_size_range, removed ggdist 3.1.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/ggdist-deprecated.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Deprecated functions and arguments in ggdist — ggdist-deprecated","text":"Matthew Kay","code":""},{"path":"http://mjskay.github.io/ggdist/reference/ggdist-ggproto.html","id":null,"dir":"Reference","previous_headings":"","what":"Base ggproto classes for ggdist — AbstractStatSlabinterval","title":"Base ggproto classes for ggdist — AbstractStatSlabinterval","text":"Base ggproto classes ggdist","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/ggdist-package.html","id":null,"dir":"Reference","previous_headings":"","what":"Visualizations of Distributions and Uncertainty — ggdist-package","title":"Visualizations of Distributions and Uncertainty — ggdist-package","text":"ggdist R package aims make easy integrate popular Bayesian modeling methods tidy data + ggplot workflow.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/ggdist-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Visualizations of Distributions and Uncertainty — ggdist-package","text":"ggdist R package provides flexible set ggplot2 geoms stats designed especially visualizing distributions uncertainty. designed frequentist Bayesian uncertainty visualization, taking view uncertainty visualization can unified perspective distribution visualization: frequentist models, one visualizes confidence distributions bootstrap distributions (see vignette(\"freq-uncertainty-vis\")); Bayesian models, one visualizes probability distributions (see vignette(\"tidybayes\", package = \"tidybayes\")). geom_slabinterval() / stat_slabinterval() family (see vignette(\"slabinterval\")) makes easy visualize point summaries intervals, eye plots, half-eye plots, ridge plots, CCDF bar plots, gradient plots, histograms, . geom_dotsinterval() / stat_dotsinterval() family (see vignette(\"dotsinterval\")) makes easy visualize dot+interval plots, Wilkinson dotplots, beeswarm plots, quantile dotplots. geom_lineribbon() / stat_lineribbon() family (see vignette(\"lineribbon\")) makes easy visualize fit lines arbitrary number uncertainty bands.","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/ggdist-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Visualizations of Distributions and Uncertainty — ggdist-package","text":"Maintainer: Matthew Kay mjskay@northwestern.edu contributors: Brenton M. Wiernik brenton@wiernik.org [contributor]","code":""},{"path":"http://mjskay.github.io/ggdist/reference/guide_rampbar.html","id":null,"dir":"Reference","previous_headings":"","what":"Continuous guide for colour ramp scales (ggplot2 guide) — guide_rampbar","title":"Continuous guide for colour ramp scales (ggplot2 guide) — guide_rampbar","text":"colour ramp bar guide shows continuous colour ramp scales mapped onto values smooth gradient. Designed use scale_fill_ramp_continuous() scale_colour_ramp_continuous(). Based guide_colourbar().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/guide_rampbar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Continuous guide for colour ramp scales (ggplot2 guide) — guide_rampbar","text":"","code":"guide_rampbar(   ...,   to = \"gray65\",   available_aes = c(\"fill_ramp\", \"colour_ramp\") )"},{"path":"http://mjskay.github.io/ggdist/reference/guide_rampbar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Continuous guide for colour ramp scales (ggplot2 guide) — guide_rampbar","text":"... Arguments passed ggplot2::guide_colourbar title character string expression indicating title guide. NULL, title shown. default (waiver()), name scale object name specified labs() used title. theme theme object style guide individually differently plot's theme settings. theme argument guide overrides, combined , plot's theme. nbin numeric specifying number bins drawing colourbar. smoother colourbar results larger value. display string indicating method display colourbar. Can one following: \"raster\" display bitmap image. \"rectangles\" display series rectangles. \"gradient\" display linear gradient. Note devices able render rasters gradients. raster logical. TRUE colourbar rendered raster object. FALSE colourbar rendered set rectangles. Note graphics devices capable rendering raster image. alpha numeric 0 1 setting colour transparency bar. Use NA preserve alpha encoded colour (default). draw.ulim logical specifying upper limit tick marks visible. draw.llim logical specifying lower limit tick marks visible. position character string indicating legend placed relative plot panels. direction character string indicating direction guide. One \"horizontal\" \"vertical.\" reverse logical. TRUE colourbar reversed. default, highest value top lowest value bottom order positive integer less 99 specifies order guide among multiple guides. controls order multiple guides displayed, contents guide . 0 (default), order determined secret algorithm. color ramp guide. Corresponds 1 scale. available_aes vector character strings listing aesthetics guide_rampbar() can drawn.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/guide_rampbar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Continuous guide for colour ramp scales (ggplot2 guide) — guide_rampbar","text":"guide object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/guide_rampbar.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Continuous guide for colour ramp scales (ggplot2 guide) — guide_rampbar","text":"guide creates smooth gradient color bars use scale_fill_ramp_continuous() scale_colour_ramp_continuous(). color ramp determined argument scale_* function, color ramp determined argument guide_rampbar(). Guides can specified scale_* function guides(). guide = \"rampbar\" scale_* syntactic sugar guide = guide_rampbar(); e.g. scale_colour_ramp_continuous(guide = \"rampbar\"). specify guide scale detail, see guides().","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/guide_rampbar.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Continuous guide for colour ramp scales (ggplot2 guide) — guide_rampbar","text":"Matthew Kay","code":""},{"path":"http://mjskay.github.io/ggdist/reference/guide_rampbar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Continuous guide for colour ramp scales (ggplot2 guide) — guide_rampbar","text":"","code":"library(dplyr) library(ggplot2) library(distributional)  # The default guide for ramp scales is guide_legend(), which creates a # discrete style scale: tibble(d = dist_uniform(0, 1)) %>%   ggplot(aes(y = 0, xdist = d)) +   stat_slab(aes(fill_ramp = after_stat(x)), fill = \"blue\") +   scale_fill_ramp_continuous(from = \"red\")   # We can use guide_rampbar() to instead create a continuous guide, but # it does not know what color to ramp to (defaults to \"gray65\"): tibble(d = dist_uniform(0, 1)) %>%   ggplot(aes(y = 0, xdist = d)) +   stat_slab(aes(fill_ramp = after_stat(x)), fill = \"blue\") +   scale_fill_ramp_continuous(from = \"red\", guide = guide_rampbar())   # We can tell the guide what color to ramp to using the `to` argument: tibble(d = dist_uniform(0, 1)) %>%   ggplot(aes(y = 0, xdist = d)) +   stat_slab(aes(fill_ramp = after_stat(x)), fill = \"blue\") +   scale_fill_ramp_continuous(from = \"red\", guide = guide_rampbar(to = \"blue\"))"},{"path":"http://mjskay.github.io/ggdist/reference/lkjcorr_marginal.html","id":null,"dir":"Reference","previous_headings":"","what":"Marginal distribution of a single correlation from an LKJ distribution — lkjcorr_marginal","title":"Marginal distribution of a single correlation from an LKJ distribution — lkjcorr_marginal","text":"Marginal distribution correlation single cell correlation matrix distributed according LKJ distribution.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/lkjcorr_marginal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Marginal distribution of a single correlation from an LKJ distribution — lkjcorr_marginal","text":"","code":"dlkjcorr_marginal(x, K, eta, log = FALSE)  plkjcorr_marginal(q, K, eta, lower.tail = TRUE, log.p = FALSE)  qlkjcorr_marginal(p, K, eta, lower.tail = TRUE, log.p = FALSE)  rlkjcorr_marginal(n, K, eta)"},{"path":"http://mjskay.github.io/ggdist/reference/lkjcorr_marginal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Marginal distribution of a single correlation from an LKJ distribution — lkjcorr_marginal","text":"x, q vector quantiles. K Dimension correlation matrix. Must greater equal 2. eta Parameter controlling shape distribution log, log.p logical; TRUE, probabilities p given log(p). lower.tail logical; TRUE (default), probabilities     \\(P[X \\le x]\\) otherwise, \\(P[X > x]\\). p vector probabilities. n number observations. length(n) > 1, length     taken number required.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/lkjcorr_marginal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Marginal distribution of a single correlation from an LKJ distribution — lkjcorr_marginal","text":"dlkjcorr_marginal gives density plkjcorr_marginal gives cumulative distribution function (CDF) qlkjcorr_marginal gives quantile function (inverse CDF) rlkjcorr_marginal generates random draws. length result determined n rlkjcorr_marginal, maximum lengths numerical arguments functions. numerical arguments n recycled length result. first elements logical arguments used.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/lkjcorr_marginal.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Marginal distribution of a single correlation from an LKJ distribution — lkjcorr_marginal","text":"LKJ distribution distribution correlation matrices single parameter, \\(\\eta\\). given \\(\\eta\\) \\(K \\times K\\) correlation matrix \\(R\\): $$R \\sim \\textrm{LKJ}(\\eta)$$ -diagonal entry \\(R\\), \\(r_{ij}: \\ne j\\), following marginal distribution (Lewandowski, Kurowicka, Joe 2009): $$\\frac{r_{ij} + 1}{2} \\sim \\textrm{Beta}\\left(\\eta - 1 + \\frac{K}{2}, \\eta - 1 + \\frac{K}{2}\\right) $$ words, \\(r_{ij}\\) marginally distributed according Beta distribution scaled \\((-1,1)\\).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/lkjcorr_marginal.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Marginal distribution of a single correlation from an LKJ distribution — lkjcorr_marginal","text":"Lewandowski, D., Kurowicka, D., & Joe, H. (2009). Generating random correlation matrices based vines extended onion method. Journal Multivariate Analysis, 100(9), 1989--2001. doi:10.1016/j.jmva.2009.04.008 .","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/lkjcorr_marginal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Marginal distribution of a single correlation from an LKJ distribution — lkjcorr_marginal","text":"","code":"library(dplyr) library(ggplot2)  theme_set(theme_ggdist())  expand.grid(   eta = 1:6,   K = 2:6 ) %>%   ggplot(aes(y = ordered(eta), dist = \"lkjcorr_marginal\", arg1 = K, arg2 = eta)) +   stat_slab() +   facet_grid(~ paste0(K, \"x\", K)) +   scale_y_discrete(limits = rev) +   labs(     title = paste0(       \"Marginal correlation for LKJ(eta) prior on different matrix sizes:\\n\",       \"dlkjcorr_marginal(K, eta)\"     ),     subtitle = \"Correlation matrix size (KxK)\",     y = \"eta\",     x = \"Marginal correlation\"   ) +   theme(axis.title = element_text(hjust = 0))"},{"path":"http://mjskay.github.io/ggdist/reference/marginalize_lkjcorr.html","id":null,"dir":"Reference","previous_headings":"","what":"Turn spec for LKJ distribution into spec for marginal LKJ distribution — marginalize_lkjcorr","title":"Turn spec for LKJ distribution into spec for marginal LKJ distribution — marginalize_lkjcorr","text":"Turns specs LKJ correlation matrix distribution returned parse_dist() specs marginal distribution single cell LKJ-distributed correlation matrix (.e., lkjcorr_marginal()). Useful visualizing prior correlations LKJ distributions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/marginalize_lkjcorr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Turn spec for LKJ distribution into spec for marginal LKJ distribution — marginalize_lkjcorr","text":"","code":"marginalize_lkjcorr(   data,   K,   predicate = NULL,   dist = \".dist\",   args = \".args\",   dist_obj = \".dist_obj\" )"},{"path":"http://mjskay.github.io/ggdist/reference/marginalize_lkjcorr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Turn spec for LKJ distribution into spec for marginal LKJ distribution — marginalize_lkjcorr","text":"data data frame containing column distribution names (\".dist\" default) list column distribution arguments (\".args\" default), output parse_dist(). K Dimension correlation matrix. Must greater equal 2. predicate bare expression selecting rows data modify. useful data contains one row LKJ prior want modify distributions; case, give row predicate expression evaluates TRUE rows want modify. NULL (default), lkjcorr distributions data modified. dist name column containing distribution names. See parse_dist(). args name column containing distribution arguments. See parse_dist(). dist_obj name column contain distributional object representing distribution. See parse_dist().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/marginalize_lkjcorr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Turn spec for LKJ distribution into spec for marginal LKJ distribution — marginalize_lkjcorr","text":"data frame size column names input, dist, args, dist_obj columns modified rows dist == \"lkjcorr\" represent marginal LKJ correlation distribution name lkjcorr_marginal args K equal input value K.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/marginalize_lkjcorr.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Turn spec for LKJ distribution into spec for marginal LKJ distribution — marginalize_lkjcorr","text":"LKJ(eta) prior correlation matrix induces marginal prior correlation matrix depends value eta K, dimension \\(K \\times K\\) correlation matrix. Thus visualize marginal prior correlations, necessary specify value K, depends model specification looks like. Given data frame representing parsed distribution specifications (returned parse_dist()), function updates rows .dist == \"lkjcorr\" first argument distribution (stored .args) equal specified dimension correlation matrix (K), changes distribution name .dist \"lkjcorr_marginal\", assigns distributional object representing distribution .dist_obj. allows distribution easily visualized using stat_slabinterval() family ggplot2 stats.","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/marginalize_lkjcorr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Turn spec for LKJ distribution into spec for marginal LKJ distribution — marginalize_lkjcorr","text":"","code":"library(dplyr) library(ggplot2)  # Say we have an LKJ(3) prior on a 2x2 correlation matrix. We can visualize # its marginal distribution as follows... data.frame(prior = \"lkjcorr(3)\") %>%   parse_dist(prior) %>%   marginalize_lkjcorr(K = 2) %>%   ggplot(aes(y = prior, xdist = .dist_obj)) +   stat_halfeye() +   xlim(-1, 1) +   xlab(\"Marginal correlation for LKJ(3) prior on 2x2 correlation matrix\")   # Say our prior list has multiple LKJ priors on correlation matrices # of different sizes, we can supply a predicate expression to select # only those rows we want to modify data.frame(coef = c(\"a\", \"b\"), prior = \"lkjcorr(3)\") %>%   parse_dist(prior) %>%   marginalize_lkjcorr(K = 2, coef == \"a\") %>%   marginalize_lkjcorr(K = 4, coef == \"b\") #>   coef      prior            .dist .args              .dist_obj #> 1    a lkjcorr(3) lkjcorr_marginal  2, 3 lkjcorr_marginal(2, 3) #> 2    b lkjcorr(3) lkjcorr_marginal  4, 3 lkjcorr_marginal(4, 3)"},{"path":"http://mjskay.github.io/ggdist/reference/parse_dist.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse distribution specifications into columns of a data frame — parse_dist","title":"Parse distribution specifications into columns of a data frame — parse_dist","text":"Parses simple string distribution specifications, like \"normal(0, 1)\", two columns data frame, suitable use dist args aesthetics stat_slabinterval() shortcut stats (like stat_halfeye()). format output brms::get_prior, making particularly useful visualizing priors brms models.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/parse_dist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse distribution specifications into columns of a data frame — parse_dist","text":"","code":"parse_dist(   object,   ...,   dist = \".dist\",   args = \".args\",   dist_obj = \".dist_obj\",   package = NULL,   to_r_names = TRUE )  # S3 method for default parse_dist(object, ...)  # S3 method for data.frame parse_dist(   object,   dist_col,   ...,   dist = \".dist\",   args = \".args\",   dist_obj = \".dist_obj\",   package = NULL,   lb = \"lb\",   ub = \"ub\",   to_r_names = TRUE )  # S3 method for character parse_dist(   object,   ...,   dist = \".dist\",   args = \".args\",   dist_obj = \".dist_obj\",   package = NULL,   to_r_names = TRUE )  # S3 method for factor parse_dist(   object,   ...,   dist = \".dist\",   args = \".args\",   dist_obj = \".dist_obj\",   package = NULL,   to_r_names = TRUE )  # S3 method for brmsprior parse_dist(   object,   dist_col = prior,   ...,   dist = \".dist\",   args = \".args\",   dist_obj = \".dist_obj\",   package = NULL,   to_r_names = TRUE )  r_dist_name(dist_name)"},{"path":"http://mjskay.github.io/ggdist/reference/parse_dist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse distribution specifications into columns of a data frame — parse_dist","text":"object character vector containing distribution specifications data frame column containing distribution specifications. ... Arguments passed implementations parse_dist. dist name output column contain distribution name args name output column contain arguments distribution dist_obj name output column contain distributional object representing distribution package package environment search distribution functions . Passed distributional::dist_wrap(). One : NULL: use calling environment string: use environment package given name environment: use given environment to_r_names TRUE (default), certain common aliases distribution names automatically translated names R can recognize (.e., names functions starting r, p, q, d representing random number generators, distribution functions, etc. distribution), using r_dist_name function. example, \"normal\" translated \"norm\" \"lognormal\" translated \"lnorm\". dist_col bare (unquoted) column column expression resolves character vector distribution specifications. lb name input column (data.frame brms::prior objects) contains lower bound distribution, present produce truncated distribution using dist_truncated(). Ignored lb NULL object[[lb]] NA corresponding input row. ub name input column (data.frame brms::prior objects) contains upper bound distribution, present produce truncated distribution using dist_truncated(). Ignored ub NULL object[[ub]] NA corresponding input row. dist_name r_dist_name, character vector distribution names translated distribution names R recognizes. Unrecognized names left -.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/parse_dist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parse distribution specifications into columns of a data frame — parse_dist","text":"parse_dist returns data frame containing least two columns named dist args parameters. input data frame, output data frame length two columns added. input character vector factor, output two-column data frame number rows length input. r_dist_name returns character vector length input containing translations input names distribution names R can recognize.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/parse_dist.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Parse distribution specifications into columns of a data frame — parse_dist","text":"parse_dist() can applied character vectors data frame + bare column name column parse, returns data frame \".dist\" \".args\" columns added. parse_dist() uses r_dist_name() translate distribution names names recognized R. r_dist_name() takes character vector names translates common names R distribution names. Names first made valid R names using make.names(), translated (ignoring character case, \".\", \"_\"). Thus, \"lognormal\", \"LogNormal\", \"log_normal\", \"log-Normal\", number variants get translated \"lnorm\".","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/parse_dist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Parse distribution specifications into columns of a data frame — parse_dist","text":"","code":"library(dplyr)  # parse dist can operate on strings directly... parse_dist(c(\"normal(0,1)\", \"student_t(3,0,1)\")) #> # A tibble: 2 × 3 #>   .dist     .args               .dist_obj #>   <chr>     <list>                 <dist> #> 1 norm      <list [2]>         norm(0, 1) #> 2 student_t <list [3]> student_t(3, 0, 1)  # ... or on columns of a data frame, where it adds the # parsed specs back on as columns data.frame(prior = c(\"normal(0,1)\", \"student_t(3,0,1)\")) %>%   parse_dist(prior) #>              prior     .dist   .args          .dist_obj #> 1      normal(0,1)      norm    0, 1         norm(0, 1) #> 2 student_t(3,0,1) student_t 3, 0, 1 student_t(3, 0, 1)  # parse_dist is particularly useful with the output of brms::prior(), # which follows the same format as above"},{"path":"http://mjskay.github.io/ggdist/reference/partial_colour_ramp.html","id":null,"dir":"Reference","previous_headings":"","what":"Partial colour ramp (datatype) — partial_colour_ramp","title":"Partial colour ramp (datatype) — partial_colour_ramp","text":"representation partial ramp two colours: origin colour () distance origin colour target colour (amount, value 0 1). target colour ramp can filled later using ramp_colours(), producing colour.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/partial_colour_ramp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Partial colour ramp (datatype) — partial_colour_ramp","text":"","code":"partial_colour_ramp(amount = double(), from = \"white\")"},{"path":"http://mjskay.github.io/ggdist/reference/partial_colour_ramp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Partial colour ramp (datatype) — partial_colour_ramp","text":"amount Numeric vector 0 1 giving amounts ramp colour. 0 corresponds colour . Character vector giving colours ramp .","code":""},{"path":"http://mjskay.github.io/ggdist/reference/partial_colour_ramp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Partial colour ramp (datatype) — partial_colour_ramp","text":"vctrs::rcrd class \"ggdist_partial_colour_ramp\" fields \"amount\" \"\".","code":""},{"path":"http://mjskay.github.io/ggdist/reference/partial_colour_ramp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Partial colour ramp (datatype) — partial_colour_ramp","text":"datatype used scale_colour_ramp create ramped colours ggdist geoms. vctrs::rcrd datatype two fields: \"amount\", amount ramp, \"\", colour ramp . Colour ramps can applied (.e. translated colours) using ramp_colours(), can used partial_colour_ramp() implement geoms make use colour_ramp fill_ramp scales.","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/partial_colour_ramp.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Partial colour ramp (datatype) — partial_colour_ramp","text":"Matthew Kay","code":""},{"path":"http://mjskay.github.io/ggdist/reference/partial_colour_ramp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Partial colour ramp (datatype) — partial_colour_ramp","text":"","code":"pcr = partial_colour_ramp(c(0, 0.25, 0.75, 1), \"red\") pcr #> <partial_colour_ramp[4]> #> [1] [0 from red]    [0.25 from red] [0.75 from red] [1 from red]     ramp_colours(\"blue\", pcr) #> [1] \"#FF0000\" \"#E80050\" \"#9A00C3\" \"#0000FF\""},{"path":"http://mjskay.github.io/ggdist/reference/point_interval.html","id":null,"dir":"Reference","previous_headings":"","what":"Point and interval summaries for tidy data frames of draws from distributions — point_interval","title":"Point and interval summaries for tidy data frames of draws from distributions — point_interval","text":"Translates draws distributions (possibly grouped) data frame point interval summaries (set point interval summaries, multiple groups grouped data frame).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/point_interval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Point and interval summaries for tidy data frames of draws from distributions — point_interval","text":"","code":"point_interval(   .data,   ...,   .width = 0.95,   .point = median,   .interval = qi,   .simple_names = TRUE,   na.rm = FALSE,   .exclude = c(\".chain\", \".iteration\", \".draw\", \".row\"),   .prob )  # S3 method for default point_interval(   .data,   ...,   .width = 0.95,   .point = median,   .interval = qi,   .simple_names = TRUE,   na.rm = FALSE,   .exclude = c(\".chain\", \".iteration\", \".draw\", \".row\"),   .prob )  # S3 method for numeric point_interval(   .data,   ...,   .width = 0.95,   .point = median,   .interval = qi,   .simple_names = FALSE,   na.rm = FALSE,   .exclude = c(\".chain\", \".iteration\", \".draw\", \".row\"),   .prob )  # S3 method for rvar point_interval(   .data,   ...,   .width = 0.95,   .point = median,   .interval = qi,   .simple_names = TRUE,   na.rm = FALSE )  # S3 method for distribution point_interval(   .data,   ...,   .width = 0.95,   .point = median,   .interval = qi,   .simple_names = TRUE,   na.rm = FALSE )  qi(x, .width = 0.95, .prob, na.rm = FALSE)  ll(x, .width = 0.95, na.rm = FALSE)  ul(x, .width = 0.95, na.rm = FALSE)  hdi(   x,   .width = 0.95,   na.rm = FALSE,   ...,   density = density_bounded(trim = TRUE),   n = 4096,   .prob )  Mode(x, na.rm = FALSE, ...)  # S3 method for default Mode(   x,   na.rm = FALSE,   ...,   density = density_bounded(trim = TRUE),   n = 2001,   weights = NULL )  # S3 method for rvar Mode(x, na.rm = FALSE, ...)  # S3 method for distribution Mode(x, na.rm = FALSE, ...)  hdci(x, .width = 0.95, na.rm = FALSE)  mean_qi(.data, ..., .width = 0.95)  median_qi(.data, ..., .width = 0.95)  mode_qi(.data, ..., .width = 0.95)  mean_ll(.data, ..., .width = 0.95)  median_ll(.data, ..., .width = 0.95)  mode_ll(.data, ..., .width = 0.95)  mean_ul(.data, ..., .width = 0.95)  median_ul(.data, ..., .width = 0.95)  mode_ul(.data, ..., .width = 0.95)  mean_hdi(.data, ..., .width = 0.95)  median_hdi(.data, ..., .width = 0.95)  mode_hdi(.data, ..., .width = 0.95)  mean_hdci(.data, ..., .width = 0.95)  median_hdci(.data, ..., .width = 0.95)  mode_hdci(.data, ..., .width = 0.95)"},{"path":"http://mjskay.github.io/ggdist/reference/point_interval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Point and interval summaries for tidy data frames of draws from distributions — point_interval","text":".data Data frame (grouped data frame returned dplyr::group_by()) contains draws summarize. ... Bare column names expressions , evaluated context .data, represent draws summarize. empty, default columns group columns .exclude (default \".chain\", \".iteration\", \".draw\", \".row\") summarized. columns can numeric, distributional objects, posterior::rvars, list columns numeric values summarise. .width vector probabilities use determine widths resulting intervals. multiple probabilities provided, multiple rows per group generated, different probability interval (value corresponding .width column). .point Point summary function, takes vector returns single value, e.g. mean(), median(), Mode(). .interval Interval function, takes vector probability (.width) returns two-element vector representing lower upper bound interval; e.g. qi(), hdi() .simple_names TRUE single column / vector summarized, use name .lower lower end interval .upper upper end. .data vector TRUE, also set column name point summary .value. FALSE .data data frame, names lower upper intervals column x x.lower x.upper. FALSE .data vector, uses naming scheme y, ymin ymax (use ggplot). na.rm logical value indicating whether NA values stripped computation proceeds. FALSE (default), vectors summarized contain NA result point interval summaries equal NA. .exclude character vector names columns excluded summarization column names specified summarized. Default ignores several meta-data column names used ggdist tidybayes. .prob Deprecated. Use .width instead. x vector summarize (interval functions: qi hdi) density hdi() Mode(), kernel density estimator use, either function (e.g. density_bounded, density_unbounded) string giving suffix function starts density_ (e.g. \"bounded\" \"unbounded\"). default, \"bounded\", uses bounded density estimator density_bounded(), estimates bounds distribution, tends work well bounded unbounded data. n hdi() Mode(), number points use estimate highest-density intervals modes. weights Mode(), optional vector, (NULL) length x provides weights element x.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/point_interval.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Point and interval summaries for tidy data frames of draws from distributions — point_interval","text":"data frame containing point summaries intervals, least one column corresponding point summary, one lower end interval, one upper end interval, width interval (.width), type point summary (.point), type interval (.interval).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/point_interval.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Point and interval summaries for tidy data frames of draws from distributions — point_interval","text":".data data frame, ... list bare names columns (expressions derived columns) .data, point interval summaries derived. Column expressions processed using tidy evaluation framework (see rlang::eval_tidy()). column named x, resulting data frame column named x containing point summary. single column summarized .simple_names TRUE, output also contain columns .lower (lower end interval), .upper (upper end interval). Otherwise, every summarized column x, output contain x.lower (lower end interval) x.upper (upper end interval). Finally, output .width column containing ' probability interval output row. .data includes groups (see e.g. dplyr::group_by()), points intervals calculated within groups. .data vector, ... ignored result data frame one row per value .width three columns: y (point summary), ymin (lower end interval), ymax (upper end interval), .width, probability corresponding interval. behavior allows point_interval derived functions (like median_qi, mean_qi, mode_hdi, etc) easily used plot intervals ggplot stats using methods like stat_eye(), stat_halfeye(), stat_summary(). median_qi, mode_hdi, etc short forms point_interval(..., .point = median, .interval = qi), etc. qi yields quantile interval (also known percentile interval equi-tailed interval) 1x2 matrix. hdi yields highest-density interval(s) (also known highest posterior density interval). Note: distribution multimodal, hdi may return multiple intervals probability level (spread rows). may wish use hdci () instead want single highest-density interval, caveat distribution multimodal hdci highest-density interval. hdci yields highest-density continuous interval, also known shortest probability interval. Note: distribution multimodal, may actually highest-density interval (may higher-density discontinuous interval, can found using hdi). ll ul yield lower limits upper limits, respectively (opposite limit set either Inf -Inf).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/point_interval.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Point and interval summaries for tidy data frames of draws from distributions — point_interval","text":"Matthew Kay","code":""},{"path":"http://mjskay.github.io/ggdist/reference/point_interval.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Point and interval summaries for tidy data frames of draws from distributions — point_interval","text":"","code":"library(dplyr) library(ggplot2)  set.seed(123)  rnorm(1000) %>%   median_qi() #>             y      ymin     ymax .width .point .interval #> 1 0.009209639 -1.941554 2.037887   0.95 median        qi  data.frame(x = rnorm(1000)) %>%   median_qi(x, .width = c(.50, .80, .95)) #> # A tibble: 3 × 6 #>        x .lower .upper .width .point .interval #>    <dbl>  <dbl>  <dbl>  <dbl> <chr>  <chr>     #> 1 0.0549 -0.653  0.753   0.5  median qi        #> 2 0.0549 -1.24   1.34    0.8  median qi        #> 3 0.0549 -1.99   1.91    0.95 median qi         data.frame(     x = rnorm(1000),     y = rnorm(1000, mean = 2, sd = 2)   ) %>%   median_qi(x, y) #>             x   x.lower  x.upper        y   y.lower  y.upper .width .point #> 1 -0.05057431 -2.012529 1.934141 1.983618 -1.946229 5.947635   0.95 median #>   .interval #> 1        qi  data.frame(     x = rnorm(1000),     group = \"a\"   ) %>%   rbind(data.frame(     x = rnorm(1000, mean = 2, sd = 2),     group = \"b\")   ) %>%   group_by(group) %>%   median_qi(.width = c(.50, .80, .95)) #> # A tibble: 6 × 7 #>   group       x .lower .upper .width .point .interval #>   <chr>   <dbl>  <dbl>  <dbl>  <dbl> <chr>  <chr>     #> 1 a     -0.0328 -0.707  0.636   0.5  median qi        #> 2 b      2.06    0.759  3.44    0.5  median qi        #> 3 a     -0.0328 -1.27   1.23    0.8  median qi        #> 4 b      2.06   -0.559  4.48    0.8  median qi        #> 5 a     -0.0328 -2.00   1.84    0.95 median qi        #> 6 b      2.06   -1.75   5.91    0.95 median qi         multimodal_draws = data.frame(     x = c(rnorm(5000, 0, 1), rnorm(2500, 4, 1))   )  multimodal_draws %>%   mode_hdi(.width = c(.66, .95)) #> # A tibble: 3 × 6 #>         x .lower .upper .width .point .interval #>     <dbl>  <dbl>  <dbl>  <dbl> <chr>  <chr>     #> 1 -0.0938  -1.30   1.30   0.66 mode   hdi       #> 2 -0.0938   3.50   4.44   0.66 mode   hdi       #> 3 -0.0938  -1.72   5.50   0.95 mode   hdi        multimodal_draws %>%   ggplot(aes(x = x, y = 0)) +   stat_halfeye(point_interval = mode_hdi, .width = c(.66, .95))"},{"path":"http://mjskay.github.io/ggdist/reference/position_dodgejust.html","id":null,"dir":"Reference","previous_headings":"","what":"Dodge overlapping objects side-to-side, preserving justification — position_dodgejust","title":"Dodge overlapping objects side-to-side, preserving justification — position_dodgejust","text":"justification-preserving variant ggplot2::position_dodge() preserves vertical position geom adjusting horizontal position (vice versa horizontal orientation). Unlike ggplot2::position_dodge(), position_dodgejust() attempts preserve \"justification\" x positions relative bounds containing (xmin/xmax) (y positions relative ymin/ymax horizontal orientation). makes useful dodging annotations geoms stats geom_slabinterval() family, also preserve justification intervals relative slabs dodging.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/position_dodgejust.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dodge overlapping objects side-to-side, preserving justification — position_dodgejust","text":"","code":"position_dodgejust(   width = NULL,   preserve = c(\"total\", \"single\"),   justification = NULL )"},{"path":"http://mjskay.github.io/ggdist/reference/position_dodgejust.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dodge overlapping objects side-to-side, preserving justification — position_dodgejust","text":"width Dodging width, different width individual elements. useful want align narrow geoms wider geoms. See examples. preserve dodging preserve \"total\" width elements position, width \"single\" element? justification Justification point position (x/y) relative bounds (xmin/xmax ymin/ymax), 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). used xmin/xmax/ymin/ymax supplied; case, justification used along width determine bounds object prior dodging.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/position_dodgejust.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Dodge overlapping objects side-to-side, preserving justification — position_dodgejust","text":"","code":"library(dplyr) library(ggplot2) library(distributional)  dist_df = tribble(   ~group, ~subgroup, ~mean, ~sd,   1,          \"h\",     5,   1,   2,          \"h\",     7,   1.5,   3,          \"h\",     8,   1,   3,          \"i\",     9,   1,   3,          \"j\",     7,   1 )  # An example with normal \"dodge\" positioning # Notice how dodge points are placed in the center of their bounding boxes, # which can cause slabs to be positioned outside their bounds. dist_df %>%   ggplot(aes(     x = factor(group), ydist = dist_normal(mean, sd),     fill = subgroup   )) +   stat_halfeye(     position = \"dodge\"   ) +   geom_rect(     aes(xmin = group, xmax = group + 1, ymin = 2, ymax = 13, color = subgroup),     position = \"dodge\",     data = . %>% filter(group == 3),     alpha = 0.1   ) +   geom_point(     aes(x = group, y = 7.5, color = subgroup),     position = position_dodge(width = 1),     data = . %>% filter(group == 3),     shape = 1,     size = 4,     stroke = 1.5   ) +   scale_fill_brewer(palette = \"Set2\") +   scale_color_brewer(palette = \"Dark2\")   # This same example with \"dodgejust\" positioning. For the points we # supply a justification parameter to position_dodgejust which mimics the # justification parameter of stat_halfeye, ensuring that they are # placed appropriately. On slabinterval family geoms, position_dodgejust() # will automatically detect the appropriate justification. dist_df %>%   ggplot(aes(     x = factor(group), ydist = dist_normal(mean, sd),     fill = subgroup   )) +   stat_halfeye(     position = \"dodgejust\"   ) +   geom_rect(     aes(xmin = group, xmax = group + 1, ymin = 2, ymax = 13, color = subgroup),     position = \"dodgejust\",     data = . %>% filter(group == 3),     alpha = 0.1   ) +   geom_point(     aes(x = group, y = 7.5, color = subgroup),     position = position_dodgejust(width = 1, justification = 0),     data = . %>% filter(group == 3),     shape = 1,     size = 4,     stroke = 1.5   ) +   scale_fill_brewer(palette = \"Set2\") +   scale_color_brewer(palette = \"Dark2\")"},{"path":"http://mjskay.github.io/ggdist/reference/Pr_.html","id":null,"dir":"Reference","previous_headings":"","what":"Probability expressions in ggdist aesthetics — Pr_","title":"Probability expressions in ggdist aesthetics — Pr_","text":"Experimental probability-like expressions can used place after_stat() expressions aesthetic assignments ggdist stats.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/Pr_.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Probability expressions in ggdist aesthetics — Pr_","text":"","code":"Pr_(x)  p_(x)"},{"path":"http://mjskay.github.io/ggdist/reference/Pr_.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Probability expressions in ggdist aesthetics — Pr_","text":"x Bare (unevaluated) expressions. See Details.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/Pr_.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Probability expressions in ggdist aesthetics — Pr_","text":"Pr_() p_() experimental mini-language specifying aesthetic values based probabilities probability densities derived distributions supplied ggdist stats (e.g., stat_slabinterval(), stat_dotsinterval(), etc.). generate expressions use after_stat() computed variables stat (cdf pdf; see e.g. Computed Variables section stat_slabinterval()) compute desired probabilities densities. example, one way map density distribution onto alpha aesthetic slab use after_stat(pdf):   ggdist probability expressions offer alternative, equivalent syntax:   p_(x) probability density function. use !! necessary splice generated expression aes() call; information, see quasiquotation.","code":"ggplot() +    stat_slab(aes(xdist = distributional::dist_normal(), alpha = after_stat(pdf))) ggplot() +    stat_slab(aes(xdist = distributional::dist_normal(), alpha = !!p_(x)))"},{"path":"http://mjskay.github.io/ggdist/reference/Pr_.html","id":"probability-expressions","dir":"Reference","previous_headings":"","what":"Probability expressions","title":"Probability expressions in ggdist aesthetics — Pr_","text":"Probability expressions consist call Pr_() p_() containing small number valid combinations operators variable names. Valid variables probability expressions include: x, y, value: values along x y axis. value orientation-neutral form. xdist, ydist, dist: distributions mapped along x y axis. dist orientation-neutral form. X Y can also used synonyms xdist ydist. interval: smallest interval containing current x/y value. Pr_() generates expressions probabilities, e.g. cumulative distribution functions (CDFs). Valid operators inside Pr_() : <, <=, >, >=: generates values cumulative distribution function (CDF) complementary CDF comparing one {x, y, value} one {xdist, ydist, dist, X, Y}. example, Pr_(xdist <= x) gives CDF Pr_(xdist > x) gives CCDF. %%: currently can used interval right-hand side: gives probability {x, y, value} (left-hand side) smallest interval stat generated contains value; e.g. Pr_(x %% interval). p_() generates expressions probability density functions probability mass functions (depending underlying distribution continuous discrete). currently allow operators expression, must passed one x, y, value.","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/Pr_.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Probability expressions in ggdist aesthetics — Pr_","text":"","code":"library(ggplot2) library(distributional)  df = data.frame(   d = c(dist_normal(2.7, 1), dist_lognormal(1, 1/3)),   name = c(\"normal\", \"lognormal\") )  # map density onto alpha of the fill ggplot(df, aes(y = name, xdist = d)) +   stat_slabinterval(aes(alpha = !!p_(x)))   # map CCDF onto thickness (like stat_ccdfinterval()) ggplot(df, aes(y = name, xdist = d)) +   stat_slabinterval(aes(thickness = !!Pr_(xdist > x)))   # map containing interval onto fill ggplot(df, aes(y = name, xdist = d)) +   stat_slabinterval(aes(fill = !!Pr_(x %in% interval)))   # the color scale in the previous example is not great, so turn the # probability into an ordered factor and adjust the fill scale. # Though, see also the `level` computed variable in `stat_slabinterval()`, # which is probably easier to use to create this style of chart. ggplot(df, aes(y = name, xdist = d)) +   stat_slabinterval(aes(fill = ordered(!!Pr_(x %in% interval)))) +   scale_fill_brewer(direction = -1)"},{"path":"http://mjskay.github.io/ggdist/reference/ramp_colours.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply partial colour ramps — ramp_colours","title":"Apply partial colour ramps — ramp_colours","text":"Given vectors colours partial_colour_ramps, ramps colours according parameters partial colour ramps, returning vector length inputs giving transformed (ramped) colours.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/ramp_colours.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Apply partial colour ramps — ramp_colours","text":"","code":"ramp_colours(colour, ramp)"},{"path":"http://mjskay.github.io/ggdist/reference/ramp_colours.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Apply partial colour ramps — ramp_colours","text":"colour character vector colours. ramp partial_colour_ramp vector.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/ramp_colours.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Apply partial colour ramps — ramp_colours","text":"character vector colours.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/ramp_colours.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Apply partial colour ramps — ramp_colours","text":"Takes vectors colours partial_colour_ramps produces colours interpolating colour target colour specified amount (amount corresponding fields ramp). example, add support fill_ramp aesthetic geometry, line used inside draw_group() draw_panel() method geom:","code":"data$fill = ramp_colours(data$fill, data$fill_ramp)"},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/ramp_colours.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Apply partial colour ramps — ramp_colours","text":"Matthew Kay","code":""},{"path":"http://mjskay.github.io/ggdist/reference/ramp_colours.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Apply partial colour ramps — ramp_colours","text":"","code":"pcr = partial_colour_ramp(c(0, 0.25, 0.75, 1), \"red\") pcr #> <partial_colour_ramp[4]> #> [1] [0 from red]    [0.25 from red] [0.75 from red] [1 from red]     ramp_colours(\"blue\", pcr) #> [1] \"#FF0000\" \"#E80050\" \"#9A00C3\" \"#0000FF\""},{"path":"http://mjskay.github.io/ggdist/reference/RankCorr.html","id":null,"dir":"Reference","previous_headings":"","what":"Thinned subset of posterior sample from a Bayesian analysis of perception of correlation. — RankCorr","title":"Thinned subset of posterior sample from a Bayesian analysis of perception of correlation. — RankCorr","text":"Data Kay Heer (2016), primarily used testing examples.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/RankCorr.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Thinned subset of posterior sample from a Bayesian analysis of perception of correlation. — RankCorr","text":"details, see Kay Heer (2016) Github repository describing analysis: https://github.com/mjskay/ranking-correlation. original experiment (analysis ) described Harrison et al. (2014). data(\"RankCorr\") substantially thinned version original posterior sample omitted several parameters order manageable size. data(\"RankCorr_u_tau\") used testing examples roughly equivalent following:","code":"data(\"RankCorr\")  RankCorr_u_tau = tidybayes::spread_draws(RankCorr, u_tau[i]))"},{"path":"http://mjskay.github.io/ggdist/reference/RankCorr.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Thinned subset of posterior sample from a Bayesian analysis of perception of correlation. — RankCorr","text":"Kay, Matthew, Jeffrey Heer. (2016). \"Beyond Weber's law: second look ranking visualizations correlation.\" IEEE transactions visualization computer graphics 22(1): 469-478. doi:10.1109/TVCG.2015.2467671 Harrison, Lane, Fumeng Yang, Steven Franconeri, Remco Chang. (2014). \"Ranking visualizations correlation using Weber's law.\" IEEE transactions visualization computer graphics 20(12): 1943-1952. doi:10.1109/TVCG.2014.2346979","code":""},{"path":"http://mjskay.github.io/ggdist/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. ggplot2 waiver","code":""},{"path":"http://mjskay.github.io/ggdist/reference/scale_colour_ramp.html","id":null,"dir":"Reference","previous_headings":"","what":"Secondary color scale that ramps from another color (ggplot2 scale) — scale_colour_ramp","title":"Secondary color scale that ramps from another color (ggplot2 scale) — scale_colour_ramp","text":"scale creates secondary scale modifies fill color scale geoms support (geom_lineribbon() geom_slabinterval()) \"ramp\" secondary color (default white) primary fill color (determined standard color fill aesthetics). uses partial_colour_ramp() data type.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/scale_colour_ramp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Secondary color scale that ramps from another color (ggplot2 scale) — scale_colour_ramp","text":"","code":"scale_colour_ramp_continuous(   from = \"white\",   ...,   limits = function(l) c(min(0, l[[1]]), l[[2]]),   range = c(0, 1),   guide = \"legend\",   aesthetics = \"colour_ramp\" )  scale_color_ramp_continuous(   from = \"white\",   ...,   limits = function(l) c(min(0, l[[1]]), l[[2]]),   range = c(0, 1),   guide = \"legend\",   aesthetics = \"colour_ramp\" )  scale_colour_ramp_discrete(   from = \"white\",   ...,   range = c(0.2, 1),   aesthetics = \"colour_ramp\" )  scale_color_ramp_discrete(   from = \"white\",   ...,   range = c(0.2, 1),   aesthetics = \"colour_ramp\" )  scale_fill_ramp_continuous(..., aesthetics = \"fill_ramp\")  scale_fill_ramp_discrete(..., aesthetics = \"fill_ramp\")"},{"path":"http://mjskay.github.io/ggdist/reference/scale_colour_ramp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Secondary color scale that ramps from another color (ggplot2 scale) — scale_colour_ramp","text":"color ramp . Corresponds 0 scale. ... Arguments passed underlying scale guide functions. E.g. scale_colour_ramp_discrete() passes arguments discrete_scale(), scale_colour_ramp_continuous() passes arguments continuous_scale(). See functions details. limits One : NULL use default scale range numeric vector length two providing limits scale. Use NA refer existing minimum maximum function accepts existing (automatic) limits returns new limits. Also accepts rlang lambda function notation. Note setting limits positional scales remove data outside limits. purpose zoom, use limit argument coordinate system (see coord_cartesian()). range numeric vector length 2 specifies minimum maximum values scale transformation. values 0 (color) 1 (color determined fill aesthetic). guide function used create guide name. scale_colour_ramp_continuous() scale_fill_ramp_continuous(), guide_rampbar() can used create gradient color bars. See guides() information guides. aesthetics Names aesthetics set scales .","code":""},{"path":"http://mjskay.github.io/ggdist/reference/scale_colour_ramp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Secondary color scale that ramps from another color (ggplot2 scale) — scale_colour_ramp","text":"ggplot2::Scale representing scale colour_ramp /fill_ramp aesthetics ggdist geoms. Can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/scale_colour_ramp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Secondary color scale that ramps from another color (ggplot2 scale) — scale_colour_ramp","text":"scales transform data partial_colour_ramps. partial_colour_ramp pair two values: colour numeric amount 0 1 representing distance target color (0 indicates color 1 target color). target color determined corresponding aesthetic: example, colour_ramp aesthetic creates ramps whatever value colour aesthetic ; fill_ramp aesthetic creates ramps whatever value fill aesthetic . colour_ramp aesthetic set, ggdist geometries modify colour applying colour ramp colour (similarly fill_ramp fill). Colour ramps can applied (.e. translated colours) using ramp_colours(), can used partial_colour_ramp() implement geoms make use colour_ramp fill_ramp scales.","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/scale_colour_ramp.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Secondary color scale that ramps from another color (ggplot2 scale) — scale_colour_ramp","text":"Matthew Kay","code":""},{"path":"http://mjskay.github.io/ggdist/reference/scale_colour_ramp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Secondary color scale that ramps from another color (ggplot2 scale) — scale_colour_ramp","text":"","code":"library(dplyr) library(ggplot2) library(distributional)  tibble(d = dist_uniform(0, 1)) %>%   ggplot(aes(y = 0, xdist = d)) +   stat_slab(aes(fill_ramp = after_stat(x)))   tibble(d = dist_uniform(0, 1)) %>%   ggplot(aes(y = 0, xdist = d)) +   stat_slab(aes(fill_ramp = after_stat(x)), fill = \"blue\") +   scale_fill_ramp_continuous(from = \"red\")   # you can invert the order of `range` to change the order of the blend tibble(d = dist_normal(0, 1)) %>%   ggplot(aes(y = 0, xdist = d)) +   stat_slab(aes(fill_ramp = after_stat(cut_cdf_qi(cdf))), fill = \"blue\") +   scale_fill_ramp_discrete(from = \"red\", range = c(1, 0))"},{"path":"http://mjskay.github.io/ggdist/reference/scale_side_mirrored.html","id":null,"dir":"Reference","previous_headings":"","what":"Side scale for mirrored slabs (ggplot2 scale) — scale_side_mirrored","title":"Side scale for mirrored slabs (ggplot2 scale) — scale_side_mirrored","text":"scale creates mirrored slabs side aesthetic geom_slabinterval() geom_dotsinterval() family geoms stats. works discrete variables two three levels.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/scale_side_mirrored.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Side scale for mirrored slabs (ggplot2 scale) — scale_side_mirrored","text":"","code":"scale_side_mirrored(start = \"topright\", ..., aesthetics = \"side\")"},{"path":"http://mjskay.github.io/ggdist/reference/scale_side_mirrored.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Side scale for mirrored slabs (ggplot2 scale) — scale_side_mirrored","text":"start side start . Can valid value side aesthetic except \"\". ... Arguments passed ggplot2::discrete_scale scale_name name scale used error messages associated scale. palette palette function called single integer argument (number levels scale) returns values take (e.g., scales::pal_hue()). name name scale. Used axis legend title. waiver(), default, name scale taken first mapping used aesthetic. NULL, legend title omitted. breaks One : NULL breaks waiver() default breaks (scale limits) character vector breaks function takes limits input returns breaks output. Also accepts rlang lambda function notation. labels One : NULL labels waiver() default labels computed transformation object character vector giving labels (must length breaks) expression vector (must length breaks). See ?plotmath details. function takes breaks input returns labels output. Also accepts rlang lambda function notation. limits One : NULL use default scale values character vector defines possible values scale order function accepts existing (automatic) values returns new ones. Also accepts rlang lambda function notation. expand position scales, vector range expansion constants used add padding around data ensure placed distance away axes. Use convenience function expansion() generate values expand argument. defaults expand scale 5% side continuous variables, 0.6 units side discrete variables. na.translate Unlike continuous scales, discrete scales can easily show missing values, default. want remove missing values discrete scale, specify na.translate = FALSE. na.value na.translate = TRUE, aesthetic value missing values displayed ? apply position scales NA always placed far right. drop unused factor levels omitted scale? default, TRUE, uses levels appear data; FALSE uses levels factor. guide function used create guide name. See guides() information. position position scales, position axis. left right y axes, top bottom x axes. call call used construct scale reporting messages. super super class use constructed scale aesthetics Names aesthetics set scales .","code":""},{"path":"http://mjskay.github.io/ggdist/reference/scale_side_mirrored.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Side scale for mirrored slabs (ggplot2 scale) — scale_side_mirrored","text":"ggplot2::Scale representing scale side aesthetic ggdist geoms. Can added ggplot() object.","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/scale_side_mirrored.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Side scale for mirrored slabs (ggplot2 scale) — scale_side_mirrored","text":"Matthew Kay","code":""},{"path":"http://mjskay.github.io/ggdist/reference/scale_side_mirrored.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Side scale for mirrored slabs (ggplot2 scale) — scale_side_mirrored","text":"","code":"library(dplyr) library(ggplot2)  set.seed(1234) data.frame(   x = rnorm(400, c(1,4)),   g = c(\"a\",\"b\") ) %>%   ggplot(aes(x, fill = g, side = g)) +   geom_weave(linewidth = 0, scale = 0.5) +   scale_side_mirrored()"},{"path":"http://mjskay.github.io/ggdist/reference/scale_thickness.html","id":null,"dir":"Reference","previous_headings":"","what":"Slab thickness scale (ggplot2 scale) — scale_thickness","title":"Slab thickness scale (ggplot2 scale) — scale_thickness","text":"ggplot2 scale linearly scales thickness values geoms support thickness aesthetic (geom_slabinterval()). can used align thickness scales across multiple geoms (default, thickness normalized per-geom level instead global scale). comprehensive discussion examples slab scaling normalization, see thickness scale article.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/scale_thickness.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Slab thickness scale (ggplot2 scale) — scale_thickness","text":"","code":"scale_thickness_shared(   name = waiver(),   breaks = waiver(),   labels = waiver(),   limits = function(l) c(min(0, l[[1]]), l[[2]]),   renormalize = FALSE,   oob = scales::oob_keep,   guide = \"none\",   ... )  scale_thickness_identity(..., guide = \"none\")  thickness(x = double(), lower = NA_real_, upper = NA_real_)"},{"path":"http://mjskay.github.io/ggdist/reference/scale_thickness.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Slab thickness scale (ggplot2 scale) — scale_thickness","text":"name name scale. Used axis legend title. waiver(), default, name scale taken first mapping used aesthetic. NULL, legend title omitted. breaks One : NULL breaks waiver() default breaks computed transformation object numeric vector positions function takes limits input returns breaks output (e.g., function returned scales::extended_breaks()). Also accepts rlang lambda function notation. labels One : NULL labels waiver() default labels computed transformation object character vector giving labels (must length breaks) expression vector (must length breaks). See ?plotmath details. function takes breaks input returns labels output. Also accepts rlang lambda function notation. limits One : NULL use default scale range numeric vector length two providing limits scale. Use NA refer existing minimum maximum function accepts existing (automatic) limits returns new limits. Also accepts rlang lambda function notation. Note setting limits positional scales remove data outside limits. purpose zoom, use limit argument coordinate system (see coord_cartesian()). renormalize mapping values thickness scale, values allowed renormalized geoms (e.g. via normalize parameter geom_slabinterval())? default FALSE: scale_thickness_shared() use, geom-specific normalize parameter ignored (achieved flagging values already normalized wrapping thickness()). Set TRUE allow geoms also apply normalization. Note set renormalize TRUE, subguides created via subguide parameter geom_slabinterval() display scaled values output scale, original data values. oob One : Function handles limits outside scale limits (bounds). Also accepts rlang lambda function notation. default (scales::censor()) replaces bounds values NA. scales::squish() squishing bounds values range. scales::squish_infinite() squishing infinite values range. guide function used create guide name. See guides() information. ... Arguments passed ggplot2::continuous_scale aesthetics names aesthetics scale works . scale_name name scale used error messages associated scale. palette palette function called numeric vector values 0 1 returns corresponding output values (e.g., scales::pal_area()). minor_breaks One : NULL minor breaks waiver() default breaks (one minor break major break) numeric vector positions function given limits returns vector minor breaks. Also accepts rlang lambda function notation. function two arguments, given limits major breaks. n.breaks integer guiding number major breaks. algorithm may choose slightly different number ensure nice break labels. effect breaks = waiver(). Use NULL use default number breaks given transformation. rescaler function used scale input values range [0, 1]. always scales::rescale(), except diverging n colour gradients (.e., scale_colour_gradient2(), scale_colour_gradientn()). rescaler ignored position scales, always use scales::rescale(). Also accepts rlang lambda function notation. expand position scales, vector range expansion constants used add padding around data ensure placed distance away axes. Use convenience function expansion() generate values expand argument. defaults expand scale 5% side continuous variables, 0.6 units side discrete variables. na.value Missing values replaced value. transform continuous scales, name transformation object object . Built-transformations include \"asn\", \"atanh\", \"boxcox\", \"date\", \"exp\", \"hms\", \"identity\", \"log\", \"log10\", \"log1p\", \"log2\", \"logit\", \"modulus\", \"probability\", \"probit\", \"pseudo_log\", \"reciprocal\", \"reverse\", \"sqrt\" \"time\". transformation object bundles together transform, inverse, methods generating breaks labels. Transformation objects defined scales package, called transform_<name>. transformations require arguments, can call scales package, e.g. scales::transform_boxcox(p = 2). can create transformation scales::new_transform(). trans Deprecated favour transform. position position scales, position axis. left right y axes, top bottom x axes. call call used construct scale reporting messages. super super class use constructed scale x object (typically numeric()) converted thickness() object. lower original lower bounds thickness values scaling. upper original upper bounds thickness values scaling.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/scale_thickness.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Slab thickness scale (ggplot2 scale) — scale_thickness","text":"ggplot2::Scale representing scale thickness aesthetic ggdist geoms. Can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/scale_thickness.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Slab thickness scale (ggplot2 scale) — scale_thickness","text":"default, normalization/scaling slab thicknesses controlled geometries, ggplot2 scale function. allows various functionality otherwise possible, (1) allowing different geometries different thickness scales (2) allowing user control level aggregation (panels, groups, entire plot, etc) thickness scaling done via normalize parameter geom_slabinterval(). However, default approach one drawback: two different geoms always scaling thickness. scale_thickness_shared() offers alternative approach: added chart, geoms use thickness scale, geom-level normalization (via normalize parameters) ignored. achieved \"marking\" thickness values already normalized wrapping thickness() data type (can disabled setting renormalize = TRUE). thickness() used scale_thickness_shared() create numeric()-like objects marked units slab \"thickness\". Unlike regular numeric()s, thickness() values mapped onto thickness aesthetic rescaled scale_thickness_shared() geom_slabinterval(). cases thickness() useful directly; though can used mark values rescaled---see definitions stat_ccdfinterval() stat_gradientinterval() usages. Note: slightly typical name scale_thickness_shared() might scale_thickness_continuous(), latter name cause scale applied thickness aesthetics default according rules ggplot2 uses find default scales. Thus, retain usual behavior stat_slabinterval() (per-geom normalization thickness), scale called scale_thickness_shared().","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/scale_thickness.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Slab thickness scale (ggplot2 scale) — scale_thickness","text":"Matthew Kay","code":""},{"path":"http://mjskay.github.io/ggdist/reference/scale_thickness.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Slab thickness scale (ggplot2 scale) — scale_thickness","text":"","code":"library(distributional) library(ggplot2) library(dplyr)  prior_post = data.frame(   prior = dist_normal(0, 1),   posterior = dist_normal(0.1, 0.5) )  # By default, separate geoms have their own thickness scales, which means # distributions plotted using two separate geoms will not have their slab # functions drawn on the same scale (thus here, the two distributions have # different areas under their density curves): prior_post %>%   ggplot() +   stat_halfeye(aes(xdist = posterior)) +   stat_slab(aes(xdist = prior), fill = NA, color = \"red\")   # For this kind of prior/posterior chart, it makes more sense to have the # densities on the same scale; thus, the areas under both would be the same. # We can do that using scale_thickness_shared(): prior_post %>%   ggplot() +   stat_halfeye(aes(xdist = posterior)) +   stat_slab(aes(xdist = prior), fill = NA, color = \"#e41a1c\") +   scale_thickness_shared()"},{"path":"http://mjskay.github.io/ggdist/reference/smooth_density.html","id":null,"dir":"Reference","previous_headings":"","what":"Smooth dot positions in a dotplot using a kernel density estimator (","title":"Smooth dot positions in a dotplot using a kernel density estimator (","text":"Smooths x values using density estimator, returning new x length. Can used dotplot (e.g. geom_dots(smooth = ...)) create \"density dotplots\". Supports automatic partial function application.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/smooth_density.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Smooth dot positions in a dotplot using a kernel density estimator (","text":"","code":"smooth_bounded(   x,   density = \"bounded\",   bounds = c(NA, NA),   bounder = \"cooke\",   trim = FALSE,   ... )  smooth_unbounded(x, density = \"unbounded\", trim = FALSE, ...)"},{"path":"http://mjskay.github.io/ggdist/reference/smooth_density.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Smooth dot positions in a dotplot using a kernel density estimator (","text":"x numeric vector density Density estimator use smoothing. One : function takes numeric vector returns list elements x (giving grid points density estimator) y (corresponding densities). ggdist provides family functions following format, including density_unbounded() density_bounded(). string giving suffix function name starts \"density_\"; e.g. \"bounded\" [density_bounded()]. bounds length-2 vector min max bounds. bound NA, bound estimated data using method specified bounder. bounder Method use find missing (NA) bounds. function takes numeric vector values returns length-2 vector estimated lower upper bound distribution. Can also string giving suffix name function starts \"bounder_\". Useful values include: \"cdf\": Use CDF minimum maximum order statistics sample estimate bounds. See bounder_cdf(). \"cooke\": Use method Cooke (1979); .e. method 2.3 Loh (1984). See bounder_cooke(). \"range\": Use range x (.e min max). See bounder_range(). trim density estimate trimmed bounds data? ... Arguments passed density estimator specified density.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/smooth_density.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Smooth dot positions in a dotplot using a kernel density estimator (","text":"numeric vector length(x), entry smoothed version corresponding entry x. x missing, returns partial application . See automatic-partial-functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/smooth_density.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Smooth dot positions in a dotplot using a kernel density estimator (","text":"Applies kernel density estimator (KDE) x, uses weighted quantiles KDE generate new set x values smoothed values. Plotted using dotplot (e.g. geom_dots(smooth = \"bounded\") geom_dots(smooth = smooth_bounded(...)), values create variation \"density dotplot\" (Zvinca 2018). plots recommended large sample sizes precise positions individual values particularly meaningful. small samples, normal dotplots generally used. Two variants supplied default: smooth_bounded(), uses density_bounded(). Passes bounds arguments estimator. smooth_unbounded(), uses density_unbounded(). generally recommended pick smooth based known bounds data, e.g. using smooth_bounded() bounds parameter finite bounds, smooth_unbounded() bounds infinite.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/smooth_density.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Smooth dot positions in a dotplot using a kernel density estimator (","text":"Zvinca, Daniel. \"pursuit diversity data visualization. Jittering data access details.\" https://www.linkedin.com/pulse/pursuit-diversity-data-visualization-jittering-access-daniel-zvinca/.","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/smooth_density.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Smooth dot positions in a dotplot using a kernel density estimator (","text":"","code":"library(ggplot2)  set.seed(1234) x = rnorm(1000)  # basic dotplot is noisy ggplot(data.frame(x), aes(x)) +   geom_dots()   # density dotplot is smoother, but does move points (most noticeable # in areas of low density) ggplot(data.frame(x), aes(x)) +   geom_dots(smooth = \"unbounded\")   # you can adjust the kernel and bandwidth... ggplot(data.frame(x), aes(x)) +   geom_dots(smooth = smooth_unbounded(kernel = \"triangular\", adjust = 0.5))   # for bounded data, you should use the bounded smoother x_beta = rbeta(1000, 0.5, 0.5)  ggplot(data.frame(x_beta), aes(x_beta)) +   geom_dots(smooth = smooth_bounded(bounds = c(0, 1)))"},{"path":"http://mjskay.github.io/ggdist/reference/smooth_discrete.html","id":null,"dir":"Reference","previous_headings":"","what":"Smooth dot positions in a dotplot of discrete values (","title":"Smooth dot positions in a dotplot of discrete values (","text":"Note: Better-looking bar dotplots typically easier achieve using layout = \"bar\" geom_dotsinterval() family instead smooth = \"bar\" smooth = \"discrete\". Smooths x values x presumed discrete, returning new x length. smooth_discrete() smooth_bar() use resolution() data apply smoothing around unique values dataset; smooth_discrete() uses kernel density estimator smooth_bar() places values evenly-spaced grid. Can used dotplot (e.g. geom_dots(smooth = ...)) create \"bar dotplots\". Supports automatic partial function application.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/smooth_discrete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Smooth dot positions in a dotplot of discrete values (","text":"","code":"smooth_discrete(   x,   kernel = c(\"rectangular\", \"gaussian\", \"epanechnikov\", \"triangular\", \"biweight\",     \"cosine\", \"optcosine\"),   width = 0.7,   ... )  smooth_bar(x, width = 0.7, ...)"},{"path":"http://mjskay.github.io/ggdist/reference/smooth_discrete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Smooth dot positions in a dotplot of discrete values (","text":"x numeric vector kernel string: smoothing kernel used. must partially match one \"gaussian\", \"rectangular\", \"triangular\", \"epanechnikov\", \"biweight\", \"cosine\", \"optcosine\". See stats::density(). width approximate width bars fraction data resolution(). ... additional parameters; smooth_discrete() passes smooth_unbounded() thereby density_unbounded(); smooth_bar() ignores .","code":""},{"path":"http://mjskay.github.io/ggdist/reference/smooth_discrete.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Smooth dot positions in a dotplot of discrete values (","text":"numeric vector length(x), entry smoothed version corresponding entry x. x missing, returns partial application . See automatic-partial-functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/smooth_discrete.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Smooth dot positions in a dotplot of discrete values (","text":"smooth_discrete() applies kernel density estimator (default: rectangular) x. automatically sets bandwidth kernel's width (kernel type) approximately width times resolution() data. means essentially creates smoothed bins around unique value. calls smooth_unbounded(). smooth_bar() generates evenly-spaced grid values spanning +/- width/2 around unique value x.","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/smooth_discrete.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Smooth dot positions in a dotplot of discrete values (","text":"","code":"library(ggplot2)  set.seed(1234) x = rpois(1000, 2)  # automatic binwidth in basic dotplot on large counts in discrete # distributions is very small ggplot(data.frame(x), aes(x)) +   geom_dots()   # NOTE: It is now recommended to use layout = \"bar\" instead of # smooth = \"discrete\" or smooth = \"bar\"; the latter are retained because # they can sometimes be useful in combination with other layouts for # more specialized (but finicky) applications. ggplot(data.frame(x), aes(x)) +   geom_dots(layout = \"bar\")   # smooth_discrete() constructs wider bins of dots ggplot(data.frame(x), aes(x)) +   geom_dots(smooth = \"discrete\")   # smooth_bar() is an alternative approach to rectangular layouts ggplot(data.frame(x), aes(x)) +   geom_dots(smooth = \"bar\")   # adjust the shape by changing the kernel or the width. epanechnikov # works well with side = \"both\" ggplot(data.frame(x), aes(x)) +   geom_dots(smooth = smooth_discrete(kernel = \"epanechnikov\", width = 0.8), side = \"both\")"},{"path":"http://mjskay.github.io/ggdist/reference/smooth_none.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply no smooth to a dotplot — smooth_none","title":"Apply no smooth to a dotplot — smooth_none","text":"Default smooth dotplots: smooth. Simply returns input values. Supports automatic partial function application.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/smooth_none.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Apply no smooth to a dotplot — smooth_none","text":"","code":"smooth_none(x, ...)"},{"path":"http://mjskay.github.io/ggdist/reference/smooth_none.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Apply no smooth to a dotplot — smooth_none","text":"x numeric vector ... ignored","code":""},{"path":"http://mjskay.github.io/ggdist/reference/smooth_none.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Apply no smooth to a dotplot — smooth_none","text":"x x missing, returns partial application . See automatic-partial-functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/smooth_none.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Apply no smooth to a dotplot — smooth_none","text":"default value smooth argument geom_dotsinterval().","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/stat_ccdfinterval.html","id":null,"dir":"Reference","previous_headings":"","what":"CCDF bar plot (shortcut stat) — stat_ccdfinterval","title":"CCDF bar plot (shortcut stat) — stat_ccdfinterval","text":"Shortcut version stat_slabinterval() geom_slabinterval() creating CCDF bar plots. Roughly equivalent :","code":"stat_slabinterval(   aes(     thickness = after_stat(thickness(1 - cdf, 0, 1)),     justification = after_stat(0.5),     side = after_stat(\"topleft\")   ),   normalize = \"none\",   expand = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_ccdfinterval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CCDF bar plot (shortcut stat) — stat_ccdfinterval","text":"","code":"stat_ccdfinterval(   mapping = NULL,   data = NULL,   geom = \"slabinterval\",   position = \"identity\",   ...,   normalize = \"none\",   expand = TRUE,   p_limits = c(NA, NA),   density = \"bounded\",   adjust = waiver(),   trim = TRUE,   breaks = waiver(),   align = \"none\",   outline_bars = FALSE,   point_interval = \"median_qi\",   slab_type = NULL,   limits = NULL,   n = 501,   .width = c(0.66, 0.95),   orientation = NA,   na.rm = FALSE,   show.legend = c(size = FALSE),   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_ccdfinterval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CCDF bar plot (shortcut stat) — stat_ccdfinterval","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). geom Use override default connection stat_ccdfinterval() geom_slabinterval() position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. paired default geom, geom_slabinterval(), include: fill_type type fill use fill color alpha varies within slab. One : \"segments\": breaks slab geometry segments unique combination fill color alpha value. approach supported graphics devices works well sharp cutoff values, can give ugly results large number unique fill colors used (gradients, like stat_gradientinterval()). \"gradient\": grid::linearGradient() used create smooth gradient fill. works well large numbers unique fill colors, requires R >= 4.1 yet supported graphics devices. writing, png() graphics device type = \"cairo\", svg() device, pdf() device, ragg::agg_png() devices known support option. R < 4.1, option fall back fill_type = \"segments\" message. \"auto\": attempts use fill_type = \"gradient\" support can auto-detected. R >= 4.2, support gradients can auto-detected graphics devices; support detected, option fall back fill_type = \"segments\" (case false negative, fill_type = \"gradient\" can set explicitly). R < 4.2, support gradients auto-detected, always fall back fill_type = \"segments\", case can set fill_type = \"gradient\" explicitly using graphics device support gradients. interval_size_domain length-2 numeric vector giving minimum maximum values size linewidth aesthetics translated actual sizes intervals drawn according interval_size_range (see documentation argument.) interval_size_range length-2 numeric vector. geom scales raw size aesthetic values drawing interval point sizes, tend thick using default settings scale_size_continuous(), give sizes range c(1, 6). interval_size_domain value indicates input domain raw size values (typically equal value range argument scale_size_continuous() function), interval_size_range indicates desired output range size values (min max actual sizes used draw intervals). time recommended change value argument, may result strange scaling legends; argument holdover earlier versions size aesthetics targeting point interval separately. want adjust size interval points separately, can also use linewidth point_size aesthetics; see sub-geometry-scales. fatten_point multiplicative factor used adjust size point relative size thickest interval line. wish specify point sizes directly, can also use point_size aesthetic scale_point_size_continuous() scale_point_size_discrete(); sizes specified aesthetic adjusted using fatten_point. arrow grid::arrow() giving arrow heads use interval, NULL arrows. subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". normalize normalize heights functions input thickness aesthetic. One : \"\": normalize maximum height across data 1. \"panels\": normalize within panels maximum height panel 1. \"xy\": normalize within x/y axis opposite orientation geom maximum height value opposite axis 1. \"groups\": normalize within values opposite axis within group maximum height group 1. \"none\": values taken normalization (probably used functions whose values [0,1], CDFs). comprehensive discussion examples slab scaling normalization, see thickness scale article. expand sample data, slab expanded limits scale? Default FALSE. Can length two control expansion lower upper limit respectively. p_limits Probability limits (vector size 2) used determine lower upper limits theoretical distributions (distributions samples ignore parameter determine limits based limits sample). E.g., c(.001, .999), slab drawn distribution quantile p = .001 quantile p = .999. lower (respectively upper) limit NA, lower (upper) limit minimum (maximum) distribution's support finite, 0.001 (0.999) finite. E.g., p_limits c(NA, NA), gamma distribution effective value p_limits c(0, .999) since gamma distribution defined (0, Inf); whereas normal distribution equivalent c(.001, .999) since normal distribution defined (-Inf, Inf). density Density estimator sample data. One : function takes numeric vector returns list elements x (giving grid points density estimator) y (corresponding densities). ggdist provides family functions following format, including density_unbounded() density_bounded(). format also compatible stats::density(). string giving suffix function name starts \"density_\"; e.g. \"bounded\" [density_bounded()], \"unbounded\" [density_unbounded()], \"histogram\" density_histogram(). Defaults \"bounded\", .e. density_bounded(), estimates bounds data uses bounded density estimator based reflection method. adjust Passed density: bandwidth density estimator sample data adjusted multiplying value. See e.g. density_bounded() information. Default (waiver()) defers default density estimator, usually 1. trim sample data, density estimate trimmed range data? Passed density estimator; see density parameter. Default TRUE. breaks Determines breakpoints defining bins. Defaults \"Scott\". Similar (exactly ) breaks argument graphics::hist(). One : scalar (length-1) numeric giving number bins vector numeric giving breakpoints histogram bins function taking x weights returning either number bins vector breakpoints string giving suffix function starts \"breaks_\". ggdist provides weighted implementations \"Sturges\", \"Scott\", \"FD\" break-finding algorithms graphics::hist(), well breaks_fixed() manually setting bin width. See breaks. example, breaks = \"Sturges\" use breaks_Sturges() algorithm, breaks = 9 create 9 bins, breaks = breaks_fixed(width = 1) set bin width 1. align Determines align breakpoints defining bins. Default (\"none\") performs alignment. One : scalar (length-1) numeric giving offset subtracted breaks. offset must 0 bin width. function taking sorted vector breaks (bin edges) returning offset subtract breaks. string giving suffix function starts \"align_\" used determine alignment, align_none(), align_boundary(), align_center(). example, align = \"none\" provide alignment, align = align_center(= 0) center bin 0, align = align_boundary(= 0) align bin edge 0. outline_bars sample data (density \"histogram\") discrete analytical distributions (whose slabs drawn histograms), determines outlines bars drawn slab_color aesthetic used. FALSE (default), outline drawn along tops bars; TRUE, outlines bars also drawn. See density_histogram(). point_interval function point_interval() family (e.g., median_qi, mean_qi, mode_hdi, etc), string giving name function family (e.g., \"median_qi\", \"mean_qi\", \"mode_hdi\", etc; string, caller's environment searched function, followed ggdist environment). function determines point summary (typically mean, median, mode) interval type (quantile interval, qi; highest-density interval, hdi; highest-density continuous interval, hdci). Output converted appropriate x- y-based aesthetics depending value orientation. See point_interval() family functions information. slab_type (deprecated) type slab function calculate: probability density (mass) function (\"pdf\"), cumulative distribution function (\"cdf\"), complementary CDF (\"ccdf\"). Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf,  1 - cdf) directly onto desired aesthetic. limits Manually-specified limits slab, vector length two. limits combined computed based p_limits well limits defined scales plot determine limits used draw slab functions: limits specify maximal limits; .e., specified, limits wider (may narrower). Use NA leave limit alone; e.g. limits = c(0, NA) ensure lower limit go 0, let upper limit determined either p_limits scale settings. n Number points evaluate function defines slab. .width .width argument passed point_interval: vector probabilities use determine widths resulting intervals. multiple probabilities provided, multiple intervals per group generated, different probability interval (value corresponding .width level generated variables). orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend layer included legends? Default c(size = FALSE), unlike geoms, match common use cases. FALSE hides legends, TRUE shows legends, NA shows mapped (default geoms). inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_ccdfinterval.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CCDF bar plot (shortcut stat) — stat_ccdfinterval","text":"ggplot2::Stat representing CCDF bar geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_ccdfinterval.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"CCDF bar plot (shortcut stat) — stat_ccdfinterval","text":"visualize sample data, data distribution, samples bootstrap distribution, Bayesian posterior, can supply samples x y aesthetic. visualize analytical distributions, can use xdist ydist aesthetic. historical reasons, can also use dist specify distribution, though recommended work well orientation detection. aesthetics can used follows: xdist, ydist, dist can distribution object distributional package (dist_normal(), dist_beta(), etc) can posterior::rvar() object. Since functions vectorized, columns can passed directly aes() specification; e.g. aes(dist = dist_normal(mu, sigma)) work mu sigma columns input data frame. dist can character vector giving distribution name.  arg1, ... arg9 aesthetics (args list column) specify distribution arguments. Distribution names correspond R functions \"p\", \"q\", \"d\" functions; e.g. \"norm\" valid distribution name R defines pnorm(), qnorm(), dnorm() functions Normal distributions. See parse_dist() function useful way generate dist args values human-readable distribution specs (like \"normal(0,1)\"). specs also produced packages (like brms::get_prior function brms); thus, parse_dist() combined stats described can help visualize output functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_ccdfinterval.html","id":"computed-variables","dir":"Reference","previous_headings":"","what":"Computed Variables","title":"CCDF bar plot (shortcut stat) — stat_ccdfinterval","text":"following variables computed stat made available use aesthetic specifications (aes()) using after_stat() function after_stat argument stage(): x y: slabs, input values slab function. intervals, point summary interval function. Whether x y depends orientation xmin ymin: intervals, lower end interval interval function. xmax ymax: intervals, upper end interval interval function. .width: intervals, interval width numeric value [0, 1]. slabs, width smallest interval containing value slab. level: intervals, interval width ordered factor. slabs, level smallest interval containing value slab. pdf: slabs, probability density function (PDF). options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, PDF point summary; intervals also pdf_min pdf_max PDF lower upper ends interval. cdf: slabs, cumulative distribution function. options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, CDF point summary; intervals also cdf_min cdf_max CDF lower upper ends interval. n: slabs, number data points summarized slab. slab created analytical distribution via xdist, ydist, dist aesthetic, n Inf. f: (deprecated) slabs, output values slab function (PDF, CDF, CCDF), determined slab_type. Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf, 1 - cdf) directly onto desired aesthetic.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_ccdfinterval.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"CCDF bar plot (shortcut stat) — stat_ccdfinterval","text":"slab+interval stats geoms wide variety aesthetics control appearance three sub-geometries: slab, point, interval. stats support following aesthetics: x: x position geometry (orientation = \"vertical\"); sample data summarized (orientation = \"horizontal\" sample data). y: y position geometry (orientation = \"horizontal\"); sample data summarized (orientation = \"vertical\" sample data). weight: using samples (.e. x y aesthetics, xdist ydist), optional weights applied draw. xdist: using analytical distributions, distribution map x axis: distributional object (e.g. dist_normal()) posterior::rvar() object. ydist: using analytical distributions, distribution map y axis: distributional object (e.g. dist_normal()) posterior::rvar() object. dist: using analytical distributions, name distribution (e.g. \"norm\"), distributional object (e.g. dist_normal()), posterior::rvar() object. See Details. args: Distribution arguments (args arg1, ... arg9). See Details. addition, default configuration (paired geom_slabinterval()) following aesthetics supported underlying geom: Slab-specific aesthetics thickness: thickness slab x value (orientation = \"horizontal\") y value (orientation = \"vertical\") slab. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. justification: Justification interval relative slab, 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). justification NULL (default), set automatically based value side: side \"top\"/\"right\" justification set 0, side \"bottom\"/\"left\" justification set 1, side \"\" justification set 0.5. datatype: using composite geoms directly without stat (e.g. geom_slabinterval()), datatype used indicate part geom row data targets: rows datatype = \"slab\" target slab portion geometry rows datatype = \"interval\" target interval portion geometry. set automatically using ggdist stats. Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Point-specific aesthetics shape: Shape type used draw point sub-geometry. Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Slab-specific color line override aesthetics slab_fill: Override fill: fill color slab. slab_colour: (slab_color) Override colour/color: outline color slab. slab_alpha: Override alpha: opacity slab. slab_linewidth: Override linwidth: width outline slab. slab_linetype: Override linetype: line type outline slab. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Point-specific color line override aesthetics point_fill: Override fill: fill color point. point_colour: (point_color) Override colour/color: outline color point. point_alpha: Override alpha: opacity point. point_size: Override size: size point. Deprecated aesthetics slab_size: Use slab_linewidth. interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"slabinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/stat_ccdfinterval.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"CCDF bar plot (shortcut stat) — stat_ccdfinterval","text":"","code":"library(dplyr) library(ggplot2) library(distributional)  theme_set(theme_ggdist())  # ON SAMPLE DATA set.seed(1234) df = data.frame(   group = c(\"a\", \"b\", \"c\"),   value = rnorm(1500, mean = c(5, 7, 9), sd = c(1, 1.5, 1)) ) df %>%   ggplot(aes(x = value, y = group)) +   stat_ccdfinterval() +   expand_limits(x = 0)   # ON ANALYTICAL DISTRIBUTIONS dist_df = data.frame(   group = c(\"a\", \"b\", \"c\"),   mean =  c(  5,   7,   8),   sd =    c(  1, 1.5,   1) ) # Vectorized distribution types, like distributional::dist_normal() # and posterior::rvar(), can be used with the `xdist` / `ydist` aesthetics dist_df %>%   ggplot(aes(y = group, xdist = dist_normal(mean, sd))) +   stat_ccdfinterval() +   expand_limits(x = 0)"},{"path":"http://mjskay.github.io/ggdist/reference/stat_cdfinterval.html","id":null,"dir":"Reference","previous_headings":"","what":"CDF bar plot (shortcut stat) — stat_cdfinterval","title":"CDF bar plot (shortcut stat) — stat_cdfinterval","text":"Shortcut version stat_slabinterval() geom_slabinterval() creating CDF bar plots. Roughly equivalent :","code":"stat_slabinterval(   aes(     thickness = after_stat(thickness(cdf, 0, 1)),     justification = after_stat(0.5),     side = after_stat(\"topleft\")   ),   normalize = \"none\",   expand = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_cdfinterval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CDF bar plot (shortcut stat) — stat_cdfinterval","text":"","code":"stat_cdfinterval(   mapping = NULL,   data = NULL,   geom = \"slabinterval\",   position = \"identity\",   ...,   normalize = \"none\",   expand = TRUE,   p_limits = c(NA, NA),   density = \"bounded\",   adjust = waiver(),   trim = TRUE,   breaks = waiver(),   align = \"none\",   outline_bars = FALSE,   point_interval = \"median_qi\",   slab_type = NULL,   limits = NULL,   n = 501,   .width = c(0.66, 0.95),   orientation = NA,   na.rm = FALSE,   show.legend = c(size = FALSE),   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_cdfinterval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CDF bar plot (shortcut stat) — stat_cdfinterval","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). geom Use override default connection stat_cdfinterval() geom_slabinterval() position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. paired default geom, geom_slabinterval(), include: fill_type type fill use fill color alpha varies within slab. One : \"segments\": breaks slab geometry segments unique combination fill color alpha value. approach supported graphics devices works well sharp cutoff values, can give ugly results large number unique fill colors used (gradients, like stat_gradientinterval()). \"gradient\": grid::linearGradient() used create smooth gradient fill. works well large numbers unique fill colors, requires R >= 4.1 yet supported graphics devices. writing, png() graphics device type = \"cairo\", svg() device, pdf() device, ragg::agg_png() devices known support option. R < 4.1, option fall back fill_type = \"segments\" message. \"auto\": attempts use fill_type = \"gradient\" support can auto-detected. R >= 4.2, support gradients can auto-detected graphics devices; support detected, option fall back fill_type = \"segments\" (case false negative, fill_type = \"gradient\" can set explicitly). R < 4.2, support gradients auto-detected, always fall back fill_type = \"segments\", case can set fill_type = \"gradient\" explicitly using graphics device support gradients. interval_size_domain length-2 numeric vector giving minimum maximum values size linewidth aesthetics translated actual sizes intervals drawn according interval_size_range (see documentation argument.) interval_size_range length-2 numeric vector. geom scales raw size aesthetic values drawing interval point sizes, tend thick using default settings scale_size_continuous(), give sizes range c(1, 6). interval_size_domain value indicates input domain raw size values (typically equal value range argument scale_size_continuous() function), interval_size_range indicates desired output range size values (min max actual sizes used draw intervals). time recommended change value argument, may result strange scaling legends; argument holdover earlier versions size aesthetics targeting point interval separately. want adjust size interval points separately, can also use linewidth point_size aesthetics; see sub-geometry-scales. fatten_point multiplicative factor used adjust size point relative size thickest interval line. wish specify point sizes directly, can also use point_size aesthetic scale_point_size_continuous() scale_point_size_discrete(); sizes specified aesthetic adjusted using fatten_point. arrow grid::arrow() giving arrow heads use interval, NULL arrows. subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". normalize normalize heights functions input thickness aesthetic. One : \"\": normalize maximum height across data 1. \"panels\": normalize within panels maximum height panel 1. \"xy\": normalize within x/y axis opposite orientation geom maximum height value opposite axis 1. \"groups\": normalize within values opposite axis within group maximum height group 1. \"none\": values taken normalization (probably used functions whose values [0,1], CDFs). comprehensive discussion examples slab scaling normalization, see thickness scale article. expand sample data, slab expanded limits scale? Default FALSE. Can length two control expansion lower upper limit respectively. p_limits Probability limits (vector size 2) used determine lower upper limits theoretical distributions (distributions samples ignore parameter determine limits based limits sample). E.g., c(.001, .999), slab drawn distribution quantile p = .001 quantile p = .999. lower (respectively upper) limit NA, lower (upper) limit minimum (maximum) distribution's support finite, 0.001 (0.999) finite. E.g., p_limits c(NA, NA), gamma distribution effective value p_limits c(0, .999) since gamma distribution defined (0, Inf); whereas normal distribution equivalent c(.001, .999) since normal distribution defined (-Inf, Inf). density Density estimator sample data. One : function takes numeric vector returns list elements x (giving grid points density estimator) y (corresponding densities). ggdist provides family functions following format, including density_unbounded() density_bounded(). format also compatible stats::density(). string giving suffix function name starts \"density_\"; e.g. \"bounded\" [density_bounded()], \"unbounded\" [density_unbounded()], \"histogram\" density_histogram(). Defaults \"bounded\", .e. density_bounded(), estimates bounds data uses bounded density estimator based reflection method. adjust Passed density: bandwidth density estimator sample data adjusted multiplying value. See e.g. density_bounded() information. Default (waiver()) defers default density estimator, usually 1. trim sample data, density estimate trimmed range data? Passed density estimator; see density parameter. Default TRUE. breaks Determines breakpoints defining bins. Defaults \"Scott\". Similar (exactly ) breaks argument graphics::hist(). One : scalar (length-1) numeric giving number bins vector numeric giving breakpoints histogram bins function taking x weights returning either number bins vector breakpoints string giving suffix function starts \"breaks_\". ggdist provides weighted implementations \"Sturges\", \"Scott\", \"FD\" break-finding algorithms graphics::hist(), well breaks_fixed() manually setting bin width. See breaks. example, breaks = \"Sturges\" use breaks_Sturges() algorithm, breaks = 9 create 9 bins, breaks = breaks_fixed(width = 1) set bin width 1. align Determines align breakpoints defining bins. Default (\"none\") performs alignment. One : scalar (length-1) numeric giving offset subtracted breaks. offset must 0 bin width. function taking sorted vector breaks (bin edges) returning offset subtract breaks. string giving suffix function starts \"align_\" used determine alignment, align_none(), align_boundary(), align_center(). example, align = \"none\" provide alignment, align = align_center(= 0) center bin 0, align = align_boundary(= 0) align bin edge 0. outline_bars sample data (density \"histogram\") discrete analytical distributions (whose slabs drawn histograms), determines outlines bars drawn slab_color aesthetic used. FALSE (default), outline drawn along tops bars; TRUE, outlines bars also drawn. See density_histogram(). point_interval function point_interval() family (e.g., median_qi, mean_qi, mode_hdi, etc), string giving name function family (e.g., \"median_qi\", \"mean_qi\", \"mode_hdi\", etc; string, caller's environment searched function, followed ggdist environment). function determines point summary (typically mean, median, mode) interval type (quantile interval, qi; highest-density interval, hdi; highest-density continuous interval, hdci). Output converted appropriate x- y-based aesthetics depending value orientation. See point_interval() family functions information. slab_type (deprecated) type slab function calculate: probability density (mass) function (\"pdf\"), cumulative distribution function (\"cdf\"), complementary CDF (\"ccdf\"). Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf,  1 - cdf) directly onto desired aesthetic. limits Manually-specified limits slab, vector length two. limits combined computed based p_limits well limits defined scales plot determine limits used draw slab functions: limits specify maximal limits; .e., specified, limits wider (may narrower). Use NA leave limit alone; e.g. limits = c(0, NA) ensure lower limit go 0, let upper limit determined either p_limits scale settings. n Number points evaluate function defines slab. .width .width argument passed point_interval: vector probabilities use determine widths resulting intervals. multiple probabilities provided, multiple intervals per group generated, different probability interval (value corresponding .width level generated variables). orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend layer included legends? Default c(size = FALSE), unlike geoms, match common use cases. FALSE hides legends, TRUE shows legends, NA shows mapped (default geoms). inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_cdfinterval.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CDF bar plot (shortcut stat) — stat_cdfinterval","text":"ggplot2::Stat representing CDF bar geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_cdfinterval.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"CDF bar plot (shortcut stat) — stat_cdfinterval","text":"visualize sample data, data distribution, samples bootstrap distribution, Bayesian posterior, can supply samples x y aesthetic. visualize analytical distributions, can use xdist ydist aesthetic. historical reasons, can also use dist specify distribution, though recommended work well orientation detection. aesthetics can used follows: xdist, ydist, dist can distribution object distributional package (dist_normal(), dist_beta(), etc) can posterior::rvar() object. Since functions vectorized, columns can passed directly aes() specification; e.g. aes(dist = dist_normal(mu, sigma)) work mu sigma columns input data frame. dist can character vector giving distribution name.  arg1, ... arg9 aesthetics (args list column) specify distribution arguments. Distribution names correspond R functions \"p\", \"q\", \"d\" functions; e.g. \"norm\" valid distribution name R defines pnorm(), qnorm(), dnorm() functions Normal distributions. See parse_dist() function useful way generate dist args values human-readable distribution specs (like \"normal(0,1)\"). specs also produced packages (like brms::get_prior function brms); thus, parse_dist() combined stats described can help visualize output functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_cdfinterval.html","id":"computed-variables","dir":"Reference","previous_headings":"","what":"Computed Variables","title":"CDF bar plot (shortcut stat) — stat_cdfinterval","text":"following variables computed stat made available use aesthetic specifications (aes()) using after_stat() function after_stat argument stage(): x y: slabs, input values slab function. intervals, point summary interval function. Whether x y depends orientation xmin ymin: intervals, lower end interval interval function. xmax ymax: intervals, upper end interval interval function. .width: intervals, interval width numeric value [0, 1]. slabs, width smallest interval containing value slab. level: intervals, interval width ordered factor. slabs, level smallest interval containing value slab. pdf: slabs, probability density function (PDF). options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, PDF point summary; intervals also pdf_min pdf_max PDF lower upper ends interval. cdf: slabs, cumulative distribution function. options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, CDF point summary; intervals also cdf_min cdf_max CDF lower upper ends interval. n: slabs, number data points summarized slab. slab created analytical distribution via xdist, ydist, dist aesthetic, n Inf. f: (deprecated) slabs, output values slab function (PDF, CDF, CCDF), determined slab_type. Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf, 1 - cdf) directly onto desired aesthetic.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_cdfinterval.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"CDF bar plot (shortcut stat) — stat_cdfinterval","text":"slab+interval stats geoms wide variety aesthetics control appearance three sub-geometries: slab, point, interval. stats support following aesthetics: x: x position geometry (orientation = \"vertical\"); sample data summarized (orientation = \"horizontal\" sample data). y: y position geometry (orientation = \"horizontal\"); sample data summarized (orientation = \"vertical\" sample data). weight: using samples (.e. x y aesthetics, xdist ydist), optional weights applied draw. xdist: using analytical distributions, distribution map x axis: distributional object (e.g. dist_normal()) posterior::rvar() object. ydist: using analytical distributions, distribution map y axis: distributional object (e.g. dist_normal()) posterior::rvar() object. dist: using analytical distributions, name distribution (e.g. \"norm\"), distributional object (e.g. dist_normal()), posterior::rvar() object. See Details. args: Distribution arguments (args arg1, ... arg9). See Details. addition, default configuration (paired geom_slabinterval()) following aesthetics supported underlying geom: Slab-specific aesthetics thickness: thickness slab x value (orientation = \"horizontal\") y value (orientation = \"vertical\") slab. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. justification: Justification interval relative slab, 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). justification NULL (default), set automatically based value side: side \"top\"/\"right\" justification set 0, side \"bottom\"/\"left\" justification set 1, side \"\" justification set 0.5. datatype: using composite geoms directly without stat (e.g. geom_slabinterval()), datatype used indicate part geom row data targets: rows datatype = \"slab\" target slab portion geometry rows datatype = \"interval\" target interval portion geometry. set automatically using ggdist stats. Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Point-specific aesthetics shape: Shape type used draw point sub-geometry. Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Slab-specific color line override aesthetics slab_fill: Override fill: fill color slab. slab_colour: (slab_color) Override colour/color: outline color slab. slab_alpha: Override alpha: opacity slab. slab_linewidth: Override linwidth: width outline slab. slab_linetype: Override linetype: line type outline slab. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Point-specific color line override aesthetics point_fill: Override fill: fill color point. point_colour: (point_color) Override colour/color: outline color point. point_alpha: Override alpha: opacity point. point_size: Override size: size point. Deprecated aesthetics slab_size: Use slab_linewidth. interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"slabinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/stat_cdfinterval.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"CDF bar plot (shortcut stat) — stat_cdfinterval","text":"","code":"library(dplyr) library(ggplot2) library(distributional)  theme_set(theme_ggdist())  # ON SAMPLE DATA set.seed(1234) df = data.frame(   group = c(\"a\", \"b\", \"c\"),   value = rnorm(1500, mean = c(5, 7, 9), sd = c(1, 1.5, 1)) ) df %>%   ggplot(aes(x = value, y = group)) +   stat_cdfinterval()   # ON ANALYTICAL DISTRIBUTIONS dist_df = data.frame(   group = c(\"a\", \"b\", \"c\"),   mean =  c(  5,   7,   8),   sd =    c(  1, 1.5,   1) ) # Vectorized distribution types, like distributional::dist_normal() # and posterior::rvar(), can be used with the `xdist` / `ydist` aesthetics dist_df %>%   ggplot(aes(y = group, xdist = dist_normal(mean, sd))) +   stat_cdfinterval()"},{"path":"http://mjskay.github.io/ggdist/reference/stat_dots.html","id":null,"dir":"Reference","previous_headings":"","what":"Dot plot (shortcut stat) — stat_dots","title":"Dot plot (shortcut stat) — stat_dots","text":"combination stat_slabinterval() geom_dotsinterval() sensible defaults making dot plots. geom_dotsinterval() intended use data frames already summarized using point_interval() function, stat_dots() intended use directly data frames draws analytical distributions, perform summarization using point_interval() function. Geoms based geom_dotsinterval() create dotplots automatically determine bin width ensures plot fits within available space. can also ensure dots overlap. Roughly equivalent :","code":"stat_dotsinterval(   aes(size = NULL),   geom = \"dots\",   show_point = FALSE,   show_interval = FALSE,   show.legend = NA )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_dots.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dot plot (shortcut stat) — stat_dots","text":"","code":"stat_dots(   mapping = NULL,   data = NULL,   geom = \"dots\",   position = \"identity\",   ...,   quantiles = NA,   orientation = NA,   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_dots.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dot plot (shortcut stat) — stat_dots","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). geom Use override default connection stat_dots() geom_dots() position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. paired default geom, geom_dots(), include: binwidth bin width use laying dots. One : NA (default): Dynamically select bin width based size plot drawn. pick binwidth tallest stack dots scale height (ideally exactly scale height, though guaranteed). length-1 (scalar) numeric unit object giving exact bin width. length-2 (vector) numeric unit object giving minimum maximum desired bin width. bin width dynamically selected within bounds. value numeric, assumed units data. bin width (bounds) can also specified using unit(), may useful desired dots certain point size certain percentage width/height viewport. example, unit(0.1, \"npc\") make dots exactly 10% viewport size along whichever dimension dotplot drawn; unit(c(0, 0.1), \"npc\") make dots 10% viewport size (still ensuring tallest stack less equal scale). dotsize width dots relative binwidth. default, 1.07, makes dots just bit wider bin width, manually-tuned parameter tends work well default circular shape, preventing gaps bins appearing large visually (might arise dots precisely binwidth). desired dots precisely binwidth, set dotsize = 1. stackratio distance center dots stack relative dot height. default, 1, makes dots stack just touch . layout layout method used dots: \"bin\" (default): places dots -axis midpoint bins classic Wilkinson dotplot. maintains alignment rows columns dotplot. layout slightly different classic Wilkinson algorithm : (1) nudges bins slightly avoid overlapping bins (2) input data symmetrical return symmetrical layout. \"weave\": uses basic binning approach \"bin\", places dots -axis actual positions (unless overlaps = \"nudge\", case overlaps may nudged way). maintains alignment rows align dots within columns. \"hex\": uses basic binning approach \"bin\", alternates placing dots + binwidth/4 - binwidth/4 -axis bin center. allows hexagonal packing setting stackratio less 1 (something like 0.9 tends work). \"swarm\": uses \"compactswarm\" layout beeswarm::beeswarm(). maintain alignment rows columns, can compact neat looking, especially sample data (opposed quantile dotplots theoretical distributions, may look better \"bin\", \"weave\", \"hex\"). \"bar\": discrete distributions, lays duplicate values rectangular bars. overlaps handle overlapping dots bins \"bin\", \"weave\", \"hex\" layouts (dots never overlap \"swarm\" \"bar\" layouts). purposes argument, dots considered overlapping overlapping dotsize = 1 stackratio = 1; .e. set arguments values, overlaps may still occur. One : \"keep\": leave overlapping dots . Dots may overlap (usually slightly) \"bin\", \"weave\", \"hex\" layouts. \"nudge\": nudge overlapping dots way. Overlaps avoided using constrained optimization minimizes squared distance dots desired positions, subject constraint adjacent dots overlap. smooth Smoother apply dot positions. One : function takes numeric vector dot positions returns smoothed version vector, smooth_bounded(), smooth_unbounded(), smooth_discrete(), smooth_bar()`. string indicating smoother use, suffix function name starting smooth_; e.g. \"none\" (default) applies smooth_none(), simply returns given vector without applying smoothing. Smoothing effective smoother matched support distribution; e.g. using smooth_bounded(bounds = ...). overflow handle overflow dots beyond extent geom minimum binwidth (exact binwidth) supplied. One : \"keep\": Keep overflow, drawing dots outside geom bounds. \"warn\": Keep overflow, produce warning suggesting solutions, setting binwidth = NA overflow = \"compress\". \"compress\": Compress layout. Reduces binwidth size necessary keep dots within bounds, adjusts stackratio dotsize apparent dot size user-specified minimum binwidth times user-specified dotsize. find default layout dots small, okay dots overlapping, consider setting overflow = \"compress\" supplying exact minimum dot size using binwidth. verbose TRUE, print bin width dotplot. Can useful want start automatically-selected bin width adjust manually. Bin width printed data units normalized parent coordinates \"npc\"s (see unit()). Note just want scale selected bin width fit within desired area, probably easier use scale copy scale binwidth manually, just want provide constraints bin width, can pass length-2 vector binwidth. subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". quantiles Setting value NA produce quantile dotplot: , dotplot quantiles sample distribution (analytical distributions, default NA taken mean 100 quantiles). value quantiles determines number quantiles plot. See Kay et al. (2016) Fernandes et al. (2018) information quantile dotplots. orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. can also named logical vector finely select aesthetics display. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_dots.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Dot plot (shortcut stat) — stat_dots","text":"ggplot2::Stat representing dot geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_dots.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Dot plot (shortcut stat) — stat_dots","text":"dots family stats geoms similar geom_dotplot() number differences: Dots geoms act like slabs geom_slabinterval() can given x positions (y positions horizontal orientation). Given available space lay dots, dots geoms automatically determine many bins use fit available space. Dots geoms use dynamic layout algorithm lays dots center input data symmetrical, guaranteeing symmetrical data results symmetrical plot. layout algorithm also prevents dots overlapping . shape dots geoms can changed using slab_shape aesthetic (using dotsinterval family) shape slab_shape aesthetic (using dots family) Stats geoms family include: geom_dots(): dotplots raw data. Ensures dotplot fits within available space reducing size dots automatically (may result small dots). geom_swarm() geom_weave(): dotplots raw data defaults intended create \"beeswarm\" plots. Used side = \"\" default, sets default dot size size geom_point() (binwidth = unit(1.5, \"mm\")), allowing dots overlap instead getting small. stat_dots(): dotplots raw data, distributional objects, posterior::rvar()s geom_dotsinterval(): dotplot + interval plots raw data already-calculated intervals (rarely useful directly). stat_dotsinterval(): dotplot + interval plots raw data, distributional objects, posterior::rvar()s (calculate intervals ). geom_blur_dots(): blurry dotplots allow standard deviation blur applied dot specified using sd aesthetic. stat_mcse_dots(): blurry dotplots quantiles using Monte Carlo Standard Error quantile. stat_dots() stat_dotsinterval(), used quantiles argument, particularly useful constructing quantile dotplots, can effective way communicate uncertainty using frequency framing may easier laypeople understand (Kay et al. 2016, Fernandes et al. 2018). visualize sample data, data distribution, samples bootstrap distribution, Bayesian posterior, can supply samples x y aesthetic. visualize analytical distributions, can use xdist ydist aesthetic. historical reasons, can also use dist specify distribution, though recommended work well orientation detection. aesthetics can used follows: xdist, ydist, dist can distribution object distributional package (dist_normal(), dist_beta(), etc) can posterior::rvar() object. Since functions vectorized, columns can passed directly aes() specification; e.g. aes(dist = dist_normal(mu, sigma)) work mu sigma columns input data frame. dist can character vector giving distribution name.  arg1, ... arg9 aesthetics (args list column) specify distribution arguments. Distribution names correspond R functions \"p\", \"q\", \"d\" functions; e.g. \"norm\" valid distribution name R defines pnorm(), qnorm(), dnorm() functions Normal distributions. See parse_dist() function useful way generate dist args values human-readable distribution specs (like \"normal(0,1)\"). specs also produced packages (like brms::get_prior function brms); thus, parse_dist() combined stats described can help visualize output functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_dots.html","id":"computed-variables","dir":"Reference","previous_headings":"","what":"Computed Variables","title":"Dot plot (shortcut stat) — stat_dots","text":"following variables computed stat made available use aesthetic specifications (aes()) using after_stat() function after_stat argument stage(): x y: slabs, input values slab function. intervals, point summary interval function. Whether x y depends orientation xmin ymin: intervals, lower end interval interval function. xmax ymax: intervals, upper end interval interval function. .width: intervals, interval width numeric value [0, 1]. slabs, width smallest interval containing value slab. level: intervals, interval width ordered factor. slabs, level smallest interval containing value slab. pdf: slabs, probability density function (PDF). options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, PDF point summary; intervals also pdf_min pdf_max PDF lower upper ends interval. cdf: slabs, cumulative distribution function. options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, CDF point summary; intervals also cdf_min cdf_max CDF lower upper ends interval. n: slabs, number data points summarized slab. slab created analytical distribution via xdist, ydist, dist aesthetic, n Inf. f: (deprecated) slabs, output values slab function (PDF, CDF, CCDF), determined slab_type. Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf, 1 - cdf) directly onto desired aesthetic.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_dots.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Dot plot (shortcut stat) — stat_dots","text":"dots+interval stats geoms wide variety aesthetics control appearance three sub-geometries: dots (aka slab), point, interval. stats support following aesthetics: x: x position geometry (orientation = \"vertical\"); sample data summarized (orientation = \"horizontal\" sample data). y: y position geometry (orientation = \"horizontal\"); sample data summarized (orientation = \"vertical\" sample data). weight: using samples (.e. x y aesthetics, xdist ydist), optional weights applied draw. xdist: using analytical distributions, distribution map x axis: distributional object (e.g. dist_normal()) posterior::rvar() object. ydist: using analytical distributions, distribution map y axis: distributional object (e.g. dist_normal()) posterior::rvar() object. dist: using analytical distributions, name distribution (e.g. \"norm\"), distributional object (e.g. dist_normal()), posterior::rvar() object. See Details. args: Distribution arguments (args arg1, ... arg9). See Details. addition, default configuration (paired geom_dots()) following aesthetics supported underlying geom: Dots-specific (aka Slab-specific) aesthetics family: font family used draw dots. order: order data points stacked within bins. Can used create effect \"stacked\" dots ordering dots according discrete variable. omitted (NULL), value data points used determine stacking order. applies layout \"bin\" \"hex\", layout methods fully determine x y positions. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. justification: Justification interval relative slab, 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). justification NULL (default), set automatically based value side: side \"top\"/\"right\" justification set 0, side \"bottom\"/\"left\" justification set 1, side \"\" justification set 0.5. datatype: using composite geoms directly without stat (e.g. geom_slabinterval()), datatype used indicate part geom row data targets: rows datatype = \"slab\" target slab portion geometry rows datatype = \"interval\" target interval portion geometry. set automatically using ggdist stats. Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Point-specific aesthetics shape: Shape type used draw point sub-geometry. Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Slab-specific color line override aesthetics slab_fill: Override fill: fill color slab. slab_colour: (slab_color) Override colour/color: outline color slab. slab_alpha: Override alpha: opacity slab. slab_linewidth: Override linwidth: width outline slab. slab_linetype: Override linetype: line type outline slab. slab_shape: Override shape: shape dots used draw dotplot slab. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Point-specific color line override aesthetics point_fill: Override fill: fill color point. point_colour: (point_color) Override colour/color: outline color point. point_alpha: Override alpha: opacity point. point_size: Override size: size point. Deprecated aesthetics slab_size: Use slab_linewidth. interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"dotsinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_dots.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Dot plot (shortcut stat) — stat_dots","text":"Kay, M., Kola, T., Hullman, J. R., & Munson, S. . (2016). (ish) Bus? User-centered Visualizations Uncertainty Everyday, Mobile Predictive Systems. Conference Human Factors Computing Systems - CHI '16, 5092--5103. doi:10.1145/2858036.2858558 . Fernandes, M., Walls, L., Munson, S., Hullman, J., & Kay, M. (2018). Uncertainty Displays Using Quantile Dotplots CDFs Improve Transit Decision-Making. Conference Human Factors Computing Systems - CHI '18. doi:10.1145/3173574.3173718 .","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/stat_dots.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Dot plot (shortcut stat) — stat_dots","text":"","code":"library(dplyr) library(ggplot2) library(distributional)  theme_set(theme_ggdist())  # ON SAMPLE DATA set.seed(12345) tibble(   x = rep(1:10, 100),   y = rnorm(1000, x) ) %>%   ggplot(aes(x = x, y = y)) +   stat_dots()   # ON ANALYTICAL DISTRIBUTIONS # Vectorized distribution types, like distributional::dist_normal() # and posterior::rvar(), can be used with the `xdist` / `ydist` aesthetics tibble(   x = 1:10,   sd = seq(1, 3, length.out = 10) ) %>%   ggplot(aes(x = x, ydist = dist_normal(x, sd))) +   stat_dots(quantiles = 50)"},{"path":"http://mjskay.github.io/ggdist/reference/stat_dotsinterval.html","id":null,"dir":"Reference","previous_headings":"","what":"Dots + point + interval plot (shortcut stat) — stat_dotsinterval","title":"Dots + point + interval plot (shortcut stat) — stat_dotsinterval","text":"combination stat_slabinterval() geom_dotsinterval() sensible defaults making dots + point + interval plots. geom_dotsinterval() intended use data frames already summarized using point_interval() function, stat_dotsinterval() intended use directly data frames draws analytical distributions, perform summarization using point_interval() function. Geoms based geom_dotsinterval() create dotplots automatically determine bin width ensures plot fits within available space. can also ensure dots overlap.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_dotsinterval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dots + point + interval plot (shortcut stat) — stat_dotsinterval","text":"","code":"stat_dotsinterval(   mapping = NULL,   data = NULL,   geom = \"dotsinterval\",   position = \"identity\",   ...,   quantiles = NA,   point_interval = \"median_qi\",   .width = c(0.66, 0.95),   orientation = NA,   na.rm = FALSE,   show.legend = c(size = FALSE),   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_dotsinterval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dots + point + interval plot (shortcut stat) — stat_dotsinterval","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). geom Use override default connection stat_dotsinterval() geom_dotsinterval() position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. paired default geom, geom_dotsinterval(), include: binwidth bin width use laying dots. One : NA (default): Dynamically select bin width based size plot drawn. pick binwidth tallest stack dots scale height (ideally exactly scale height, though guaranteed). length-1 (scalar) numeric unit object giving exact bin width. length-2 (vector) numeric unit object giving minimum maximum desired bin width. bin width dynamically selected within bounds. value numeric, assumed units data. bin width (bounds) can also specified using unit(), may useful desired dots certain point size certain percentage width/height viewport. example, unit(0.1, \"npc\") make dots exactly 10% viewport size along whichever dimension dotplot drawn; unit(c(0, 0.1), \"npc\") make dots 10% viewport size (still ensuring tallest stack less equal scale). dotsize width dots relative binwidth. default, 1.07, makes dots just bit wider bin width, manually-tuned parameter tends work well default circular shape, preventing gaps bins appearing large visually (might arise dots precisely binwidth). desired dots precisely binwidth, set dotsize = 1. stackratio distance center dots stack relative dot height. default, 1, makes dots stack just touch . layout layout method used dots: \"bin\" (default): places dots -axis midpoint bins classic Wilkinson dotplot. maintains alignment rows columns dotplot. layout slightly different classic Wilkinson algorithm : (1) nudges bins slightly avoid overlapping bins (2) input data symmetrical return symmetrical layout. \"weave\": uses basic binning approach \"bin\", places dots -axis actual positions (unless overlaps = \"nudge\", case overlaps may nudged way). maintains alignment rows align dots within columns. \"hex\": uses basic binning approach \"bin\", alternates placing dots + binwidth/4 - binwidth/4 -axis bin center. allows hexagonal packing setting stackratio less 1 (something like 0.9 tends work). \"swarm\": uses \"compactswarm\" layout beeswarm::beeswarm(). maintain alignment rows columns, can compact neat looking, especially sample data (opposed quantile dotplots theoretical distributions, may look better \"bin\", \"weave\", \"hex\"). \"bar\": discrete distributions, lays duplicate values rectangular bars. overlaps handle overlapping dots bins \"bin\", \"weave\", \"hex\" layouts (dots never overlap \"swarm\" \"bar\" layouts). purposes argument, dots considered overlapping overlapping dotsize = 1 stackratio = 1; .e. set arguments values, overlaps may still occur. One : \"keep\": leave overlapping dots . Dots may overlap (usually slightly) \"bin\", \"weave\", \"hex\" layouts. \"nudge\": nudge overlapping dots way. Overlaps avoided using constrained optimization minimizes squared distance dots desired positions, subject constraint adjacent dots overlap. smooth Smoother apply dot positions. One : function takes numeric vector dot positions returns smoothed version vector, smooth_bounded(), smooth_unbounded(), smooth_discrete(), smooth_bar()`. string indicating smoother use, suffix function name starting smooth_; e.g. \"none\" (default) applies smooth_none(), simply returns given vector without applying smoothing. Smoothing effective smoother matched support distribution; e.g. using smooth_bounded(bounds = ...). overflow handle overflow dots beyond extent geom minimum binwidth (exact binwidth) supplied. One : \"keep\": Keep overflow, drawing dots outside geom bounds. \"warn\": Keep overflow, produce warning suggesting solutions, setting binwidth = NA overflow = \"compress\". \"compress\": Compress layout. Reduces binwidth size necessary keep dots within bounds, adjusts stackratio dotsize apparent dot size user-specified minimum binwidth times user-specified dotsize. find default layout dots small, okay dots overlapping, consider setting overflow = \"compress\" supplying exact minimum dot size using binwidth. verbose TRUE, print bin width dotplot. Can useful want start automatically-selected bin width adjust manually. Bin width printed data units normalized parent coordinates \"npc\"s (see unit()). Note just want scale selected bin width fit within desired area, probably easier use scale copy scale binwidth manually, just want provide constraints bin width, can pass length-2 vector binwidth. interval_size_domain length-2 numeric vector giving minimum maximum values size linewidth aesthetics translated actual sizes intervals drawn according interval_size_range (see documentation argument.) interval_size_range length-2 numeric vector. geom scales raw size aesthetic values drawing interval point sizes, tend thick using default settings scale_size_continuous(), give sizes range c(1, 6). interval_size_domain value indicates input domain raw size values (typically equal value range argument scale_size_continuous() function), interval_size_range indicates desired output range size values (min max actual sizes used draw intervals). time recommended change value argument, may result strange scaling legends; argument holdover earlier versions size aesthetics targeting point interval separately. want adjust size interval points separately, can also use linewidth point_size aesthetics; see sub-geometry-scales. fatten_point multiplicative factor used adjust size point relative size thickest interval line. wish specify point sizes directly, can also use point_size aesthetic scale_point_size_continuous() scale_point_size_discrete(); sizes specified aesthetic adjusted using fatten_point. arrow grid::arrow() giving arrow heads use interval, NULL arrows. subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". quantiles Setting value NA produce quantile dotplot: , dotplot quantiles sample distribution (analytical distributions, default NA taken mean 100 quantiles). value quantiles determines number quantiles plot. See Kay et al. (2016) Fernandes et al. (2018) information quantile dotplots. point_interval function point_interval() family (e.g., median_qi, mean_qi, mode_hdi, etc), string giving name function family (e.g., \"median_qi\", \"mean_qi\", \"mode_hdi\", etc; string, caller's environment searched function, followed ggdist environment). function determines point summary (typically mean, median, mode) interval type (quantile interval, qi; highest-density interval, hdi; highest-density continuous interval, hdci). Output converted appropriate x- y-based aesthetics depending value orientation. See point_interval() family functions information. .width .width argument passed point_interval: vector probabilities use determine widths resulting intervals. multiple probabilities provided, multiple intervals per group generated, different probability interval (value corresponding .width level generated variables). orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. can also named logical vector finely select aesthetics display. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_dotsinterval.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Dots + point + interval plot (shortcut stat) — stat_dotsinterval","text":"ggplot2::Stat representing dots + point + interval geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_dotsinterval.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Dots + point + interval plot (shortcut stat) — stat_dotsinterval","text":"dots family stats geoms similar geom_dotplot() number differences: Dots geoms act like slabs geom_slabinterval() can given x positions (y positions horizontal orientation). Given available space lay dots, dots geoms automatically determine many bins use fit available space. Dots geoms use dynamic layout algorithm lays dots center input data symmetrical, guaranteeing symmetrical data results symmetrical plot. layout algorithm also prevents dots overlapping . shape dots geoms can changed using slab_shape aesthetic (using dotsinterval family) shape slab_shape aesthetic (using dots family) Stats geoms family include: geom_dots(): dotplots raw data. Ensures dotplot fits within available space reducing size dots automatically (may result small dots). geom_swarm() geom_weave(): dotplots raw data defaults intended create \"beeswarm\" plots. Used side = \"\" default, sets default dot size size geom_point() (binwidth = unit(1.5, \"mm\")), allowing dots overlap instead getting small. stat_dots(): dotplots raw data, distributional objects, posterior::rvar()s geom_dotsinterval(): dotplot + interval plots raw data already-calculated intervals (rarely useful directly). stat_dotsinterval(): dotplot + interval plots raw data, distributional objects, posterior::rvar()s (calculate intervals ). geom_blur_dots(): blurry dotplots allow standard deviation blur applied dot specified using sd aesthetic. stat_mcse_dots(): blurry dotplots quantiles using Monte Carlo Standard Error quantile. stat_dots() stat_dotsinterval(), used quantiles argument, particularly useful constructing quantile dotplots, can effective way communicate uncertainty using frequency framing may easier laypeople understand (Kay et al. 2016, Fernandes et al. 2018). visualize sample data, data distribution, samples bootstrap distribution, Bayesian posterior, can supply samples x y aesthetic. visualize analytical distributions, can use xdist ydist aesthetic. historical reasons, can also use dist specify distribution, though recommended work well orientation detection. aesthetics can used follows: xdist, ydist, dist can distribution object distributional package (dist_normal(), dist_beta(), etc) can posterior::rvar() object. Since functions vectorized, columns can passed directly aes() specification; e.g. aes(dist = dist_normal(mu, sigma)) work mu sigma columns input data frame. dist can character vector giving distribution name.  arg1, ... arg9 aesthetics (args list column) specify distribution arguments. Distribution names correspond R functions \"p\", \"q\", \"d\" functions; e.g. \"norm\" valid distribution name R defines pnorm(), qnorm(), dnorm() functions Normal distributions. See parse_dist() function useful way generate dist args values human-readable distribution specs (like \"normal(0,1)\"). specs also produced packages (like brms::get_prior function brms); thus, parse_dist() combined stats described can help visualize output functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_dotsinterval.html","id":"computed-variables","dir":"Reference","previous_headings":"","what":"Computed Variables","title":"Dots + point + interval plot (shortcut stat) — stat_dotsinterval","text":"following variables computed stat made available use aesthetic specifications (aes()) using after_stat() function after_stat argument stage(): x y: slabs, input values slab function. intervals, point summary interval function. Whether x y depends orientation xmin ymin: intervals, lower end interval interval function. xmax ymax: intervals, upper end interval interval function. .width: intervals, interval width numeric value [0, 1]. slabs, width smallest interval containing value slab. level: intervals, interval width ordered factor. slabs, level smallest interval containing value slab. pdf: slabs, probability density function (PDF). options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, PDF point summary; intervals also pdf_min pdf_max PDF lower upper ends interval. cdf: slabs, cumulative distribution function. options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, CDF point summary; intervals also cdf_min cdf_max CDF lower upper ends interval. n: slabs, number data points summarized slab. slab created analytical distribution via xdist, ydist, dist aesthetic, n Inf. f: (deprecated) slabs, output values slab function (PDF, CDF, CCDF), determined slab_type. Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf, 1 - cdf) directly onto desired aesthetic.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_dotsinterval.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Dots + point + interval plot (shortcut stat) — stat_dotsinterval","text":"dots+interval stats geoms wide variety aesthetics control appearance three sub-geometries: dots (aka slab), point, interval. stats support following aesthetics: x: x position geometry (orientation = \"vertical\"); sample data summarized (orientation = \"horizontal\" sample data). y: y position geometry (orientation = \"horizontal\"); sample data summarized (orientation = \"vertical\" sample data). weight: using samples (.e. x y aesthetics, xdist ydist), optional weights applied draw. xdist: using analytical distributions, distribution map x axis: distributional object (e.g. dist_normal()) posterior::rvar() object. ydist: using analytical distributions, distribution map y axis: distributional object (e.g. dist_normal()) posterior::rvar() object. dist: using analytical distributions, name distribution (e.g. \"norm\"), distributional object (e.g. dist_normal()), posterior::rvar() object. See Details. args: Distribution arguments (args arg1, ... arg9). See Details. addition, default configuration (paired geom_dotsinterval()) following aesthetics supported underlying geom: Dots-specific (aka Slab-specific) aesthetics family: font family used draw dots. order: order data points stacked within bins. Can used create effect \"stacked\" dots ordering dots according discrete variable. omitted (NULL), value data points used determine stacking order. applies layout \"bin\" \"hex\", layout methods fully determine x y positions. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. justification: Justification interval relative slab, 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). justification NULL (default), set automatically based value side: side \"top\"/\"right\" justification set 0, side \"bottom\"/\"left\" justification set 1, side \"\" justification set 0.5. datatype: using composite geoms directly without stat (e.g. geom_slabinterval()), datatype used indicate part geom row data targets: rows datatype = \"slab\" target slab portion geometry rows datatype = \"interval\" target interval portion geometry. set automatically using ggdist stats. Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Point-specific aesthetics shape: Shape type used draw point sub-geometry. Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Slab-specific color line override aesthetics slab_fill: Override fill: fill color slab. slab_colour: (slab_color) Override colour/color: outline color slab. slab_alpha: Override alpha: opacity slab. slab_linewidth: Override linwidth: width outline slab. slab_linetype: Override linetype: line type outline slab. slab_shape: Override shape: shape dots used draw dotplot slab. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Point-specific color line override aesthetics point_fill: Override fill: fill color point. point_colour: (point_color) Override colour/color: outline color point. point_alpha: Override alpha: opacity point. point_size: Override size: size point. Deprecated aesthetics slab_size: Use slab_linewidth. interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"dotsinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_dotsinterval.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Dots + point + interval plot (shortcut stat) — stat_dotsinterval","text":"Kay, M., Kola, T., Hullman, J. R., & Munson, S. . (2016). (ish) Bus? User-centered Visualizations Uncertainty Everyday, Mobile Predictive Systems. Conference Human Factors Computing Systems - CHI '16, 5092--5103. doi:10.1145/2858036.2858558 . Fernandes, M., Walls, L., Munson, S., Hullman, J., & Kay, M. (2018). Uncertainty Displays Using Quantile Dotplots CDFs Improve Transit Decision-Making. Conference Human Factors Computing Systems - CHI '18. doi:10.1145/3173574.3173718 .","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/stat_dotsinterval.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Dots + point + interval plot (shortcut stat) — stat_dotsinterval","text":"","code":"library(dplyr) library(ggplot2) library(distributional)  theme_set(theme_ggdist())  # ON SAMPLE DATA set.seed(12345) tibble(   x = rep(1:10, 100),   y = rnorm(1000, x) ) %>%   ggplot(aes(x = x, y = y)) +   stat_dotsinterval()   # ON ANALYTICAL DISTRIBUTIONS # Vectorized distribution types, like distributional::dist_normal() # and posterior::rvar(), can be used with the `xdist` / `ydist` aesthetics tibble(   x = 1:10,   sd = seq(1, 3, length.out = 10) ) %>%   ggplot(aes(x = x, ydist = dist_normal(x, sd))) +   stat_dotsinterval(quantiles = 50)"},{"path":"http://mjskay.github.io/ggdist/reference/stat_eye.html","id":null,"dir":"Reference","previous_headings":"","what":"Eye (violin + interval) plot (shortcut stat) — stat_eye","title":"Eye (violin + interval) plot (shortcut stat) — stat_eye","text":"Shortcut version stat_slabinterval() geom_slabinterval() creating eye (violin + interval) plots. Roughly equivalent :","code":"stat_slabinterval(   aes(side = after_stat(\"both\")) )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_eye.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Eye (violin + interval) plot (shortcut stat) — stat_eye","text":"","code":"stat_eye(   mapping = NULL,   data = NULL,   geom = \"slabinterval\",   position = \"identity\",   ...,   p_limits = c(NA, NA),   density = \"bounded\",   adjust = waiver(),   trim = TRUE,   expand = FALSE,   breaks = waiver(),   align = \"none\",   outline_bars = FALSE,   point_interval = \"median_qi\",   slab_type = NULL,   limits = NULL,   n = 501,   .width = c(0.66, 0.95),   orientation = NA,   na.rm = FALSE,   show.legend = c(size = FALSE),   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_eye.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Eye (violin + interval) plot (shortcut stat) — stat_eye","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). geom Use override default connection stat_eye() geom_slabinterval() position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. paired default geom, geom_slabinterval(), include: normalize normalize heights functions input thickness aesthetic. One : \"\": normalize maximum height across data 1. \"panels\": normalize within panels maximum height panel 1. \"xy\": normalize within x/y axis opposite orientation geom maximum height value opposite axis 1. \"groups\": normalize within values opposite axis within group maximum height group 1. \"none\": values taken normalization (probably used functions whose values [0,1], CDFs). comprehensive discussion examples slab scaling normalization, see thickness scale article. fill_type type fill use fill color alpha varies within slab. One : \"segments\": breaks slab geometry segments unique combination fill color alpha value. approach supported graphics devices works well sharp cutoff values, can give ugly results large number unique fill colors used (gradients, like stat_gradientinterval()). \"gradient\": grid::linearGradient() used create smooth gradient fill. works well large numbers unique fill colors, requires R >= 4.1 yet supported graphics devices. writing, png() graphics device type = \"cairo\", svg() device, pdf() device, ragg::agg_png() devices known support option. R < 4.1, option fall back fill_type = \"segments\" message. \"auto\": attempts use fill_type = \"gradient\" support can auto-detected. R >= 4.2, support gradients can auto-detected graphics devices; support detected, option fall back fill_type = \"segments\" (case false negative, fill_type = \"gradient\" can set explicitly). R < 4.2, support gradients auto-detected, always fall back fill_type = \"segments\", case can set fill_type = \"gradient\" explicitly using graphics device support gradients. interval_size_domain length-2 numeric vector giving minimum maximum values size linewidth aesthetics translated actual sizes intervals drawn according interval_size_range (see documentation argument.) interval_size_range length-2 numeric vector. geom scales raw size aesthetic values drawing interval point sizes, tend thick using default settings scale_size_continuous(), give sizes range c(1, 6). interval_size_domain value indicates input domain raw size values (typically equal value range argument scale_size_continuous() function), interval_size_range indicates desired output range size values (min max actual sizes used draw intervals). time recommended change value argument, may result strange scaling legends; argument holdover earlier versions size aesthetics targeting point interval separately. want adjust size interval points separately, can also use linewidth point_size aesthetics; see sub-geometry-scales. fatten_point multiplicative factor used adjust size point relative size thickest interval line. wish specify point sizes directly, can also use point_size aesthetic scale_point_size_continuous() scale_point_size_discrete(); sizes specified aesthetic adjusted using fatten_point. arrow grid::arrow() giving arrow heads use interval, NULL arrows. subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". p_limits Probability limits (vector size 2) used determine lower upper limits theoretical distributions (distributions samples ignore parameter determine limits based limits sample). E.g., c(.001, .999), slab drawn distribution quantile p = .001 quantile p = .999. lower (respectively upper) limit NA, lower (upper) limit minimum (maximum) distribution's support finite, 0.001 (0.999) finite. E.g., p_limits c(NA, NA), gamma distribution effective value p_limits c(0, .999) since gamma distribution defined (0, Inf); whereas normal distribution equivalent c(.001, .999) since normal distribution defined (-Inf, Inf). density Density estimator sample data. One : function takes numeric vector returns list elements x (giving grid points density estimator) y (corresponding densities). ggdist provides family functions following format, including density_unbounded() density_bounded(). format also compatible stats::density(). string giving suffix function name starts \"density_\"; e.g. \"bounded\" [density_bounded()], \"unbounded\" [density_unbounded()], \"histogram\" density_histogram(). Defaults \"bounded\", .e. density_bounded(), estimates bounds data uses bounded density estimator based reflection method. adjust Passed density: bandwidth density estimator sample data adjusted multiplying value. See e.g. density_bounded() information. Default (waiver()) defers default density estimator, usually 1. trim sample data, density estimate trimmed range data? Passed density estimator; see density parameter. Default TRUE. expand sample data, slab expanded limits scale? Default FALSE. Can length two control expansion lower upper limit respectively. breaks Determines breakpoints defining bins. Defaults \"Scott\". Similar (exactly ) breaks argument graphics::hist(). One : scalar (length-1) numeric giving number bins vector numeric giving breakpoints histogram bins function taking x weights returning either number bins vector breakpoints string giving suffix function starts \"breaks_\". ggdist provides weighted implementations \"Sturges\", \"Scott\", \"FD\" break-finding algorithms graphics::hist(), well breaks_fixed() manually setting bin width. See breaks. example, breaks = \"Sturges\" use breaks_Sturges() algorithm, breaks = 9 create 9 bins, breaks = breaks_fixed(width = 1) set bin width 1. align Determines align breakpoints defining bins. Default (\"none\") performs alignment. One : scalar (length-1) numeric giving offset subtracted breaks. offset must 0 bin width. function taking sorted vector breaks (bin edges) returning offset subtract breaks. string giving suffix function starts \"align_\" used determine alignment, align_none(), align_boundary(), align_center(). example, align = \"none\" provide alignment, align = align_center(= 0) center bin 0, align = align_boundary(= 0) align bin edge 0. outline_bars sample data (density \"histogram\") discrete analytical distributions (whose slabs drawn histograms), determines outlines bars drawn slab_color aesthetic used. FALSE (default), outline drawn along tops bars; TRUE, outlines bars also drawn. See density_histogram(). point_interval function point_interval() family (e.g., median_qi, mean_qi, mode_hdi, etc), string giving name function family (e.g., \"median_qi\", \"mean_qi\", \"mode_hdi\", etc; string, caller's environment searched function, followed ggdist environment). function determines point summary (typically mean, median, mode) interval type (quantile interval, qi; highest-density interval, hdi; highest-density continuous interval, hdci). Output converted appropriate x- y-based aesthetics depending value orientation. See point_interval() family functions information. slab_type (deprecated) type slab function calculate: probability density (mass) function (\"pdf\"), cumulative distribution function (\"cdf\"), complementary CDF (\"ccdf\"). Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf,  1 - cdf) directly onto desired aesthetic. limits Manually-specified limits slab, vector length two. limits combined computed based p_limits well limits defined scales plot determine limits used draw slab functions: limits specify maximal limits; .e., specified, limits wider (may narrower). Use NA leave limit alone; e.g. limits = c(0, NA) ensure lower limit go 0, let upper limit determined either p_limits scale settings. n Number points evaluate function defines slab. .width .width argument passed point_interval: vector probabilities use determine widths resulting intervals. multiple probabilities provided, multiple intervals per group generated, different probability interval (value corresponding .width level generated variables). orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend layer included legends? Default c(size = FALSE), unlike geoms, match common use cases. FALSE hides legends, TRUE shows legends, NA shows mapped (default geoms). inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_eye.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Eye (violin + interval) plot (shortcut stat) — stat_eye","text":"ggplot2::Stat representing eye (violin + interval) geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_eye.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Eye (violin + interval) plot (shortcut stat) — stat_eye","text":"visualize sample data, data distribution, samples bootstrap distribution, Bayesian posterior, can supply samples x y aesthetic. visualize analytical distributions, can use xdist ydist aesthetic. historical reasons, can also use dist specify distribution, though recommended work well orientation detection. aesthetics can used follows: xdist, ydist, dist can distribution object distributional package (dist_normal(), dist_beta(), etc) can posterior::rvar() object. Since functions vectorized, columns can passed directly aes() specification; e.g. aes(dist = dist_normal(mu, sigma)) work mu sigma columns input data frame. dist can character vector giving distribution name.  arg1, ... arg9 aesthetics (args list column) specify distribution arguments. Distribution names correspond R functions \"p\", \"q\", \"d\" functions; e.g. \"norm\" valid distribution name R defines pnorm(), qnorm(), dnorm() functions Normal distributions. See parse_dist() function useful way generate dist args values human-readable distribution specs (like \"normal(0,1)\"). specs also produced packages (like brms::get_prior function brms); thus, parse_dist() combined stats described can help visualize output functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_eye.html","id":"computed-variables","dir":"Reference","previous_headings":"","what":"Computed Variables","title":"Eye (violin + interval) plot (shortcut stat) — stat_eye","text":"following variables computed stat made available use aesthetic specifications (aes()) using after_stat() function after_stat argument stage(): x y: slabs, input values slab function. intervals, point summary interval function. Whether x y depends orientation xmin ymin: intervals, lower end interval interval function. xmax ymax: intervals, upper end interval interval function. .width: intervals, interval width numeric value [0, 1]. slabs, width smallest interval containing value slab. level: intervals, interval width ordered factor. slabs, level smallest interval containing value slab. pdf: slabs, probability density function (PDF). options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, PDF point summary; intervals also pdf_min pdf_max PDF lower upper ends interval. cdf: slabs, cumulative distribution function. options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, CDF point summary; intervals also cdf_min cdf_max CDF lower upper ends interval. n: slabs, number data points summarized slab. slab created analytical distribution via xdist, ydist, dist aesthetic, n Inf. f: (deprecated) slabs, output values slab function (PDF, CDF, CCDF), determined slab_type. Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf, 1 - cdf) directly onto desired aesthetic.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_eye.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Eye (violin + interval) plot (shortcut stat) — stat_eye","text":"slab+interval stats geoms wide variety aesthetics control appearance three sub-geometries: slab, point, interval. stats support following aesthetics: x: x position geometry (orientation = \"vertical\"); sample data summarized (orientation = \"horizontal\" sample data). y: y position geometry (orientation = \"horizontal\"); sample data summarized (orientation = \"vertical\" sample data). weight: using samples (.e. x y aesthetics, xdist ydist), optional weights applied draw. xdist: using analytical distributions, distribution map x axis: distributional object (e.g. dist_normal()) posterior::rvar() object. ydist: using analytical distributions, distribution map y axis: distributional object (e.g. dist_normal()) posterior::rvar() object. dist: using analytical distributions, name distribution (e.g. \"norm\"), distributional object (e.g. dist_normal()), posterior::rvar() object. See Details. args: Distribution arguments (args arg1, ... arg9). See Details. addition, default configuration (paired geom_slabinterval()) following aesthetics supported underlying geom: Slab-specific aesthetics thickness: thickness slab x value (orientation = \"horizontal\") y value (orientation = \"vertical\") slab. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. justification: Justification interval relative slab, 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). justification NULL (default), set automatically based value side: side \"top\"/\"right\" justification set 0, side \"bottom\"/\"left\" justification set 1, side \"\" justification set 0.5. datatype: using composite geoms directly without stat (e.g. geom_slabinterval()), datatype used indicate part geom row data targets: rows datatype = \"slab\" target slab portion geometry rows datatype = \"interval\" target interval portion geometry. set automatically using ggdist stats. Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Point-specific aesthetics shape: Shape type used draw point sub-geometry. Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Slab-specific color line override aesthetics slab_fill: Override fill: fill color slab. slab_colour: (slab_color) Override colour/color: outline color slab. slab_alpha: Override alpha: opacity slab. slab_linewidth: Override linwidth: width outline slab. slab_linetype: Override linetype: line type outline slab. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Point-specific color line override aesthetics point_fill: Override fill: fill color point. point_colour: (point_color) Override colour/color: outline color point. point_alpha: Override alpha: opacity point. point_size: Override size: size point. Deprecated aesthetics slab_size: Use slab_linewidth. interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"slabinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/stat_eye.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Eye (violin + interval) plot (shortcut stat) — stat_eye","text":"","code":"library(dplyr) library(ggplot2) library(distributional)  theme_set(theme_ggdist())  # ON SAMPLE DATA set.seed(1234) df = data.frame(   group = c(\"a\", \"b\", \"c\"),   value = rnorm(1500, mean = c(5, 7, 9), sd = c(1, 1.5, 1)) ) df %>%   ggplot(aes(x = value, y = group)) +   stat_eye()   # ON ANALYTICAL DISTRIBUTIONS dist_df = data.frame(   group = c(\"a\", \"b\", \"c\"),   mean =  c(  5,   7,   8),   sd =    c(  1, 1.5,   1) ) # Vectorized distribution types, like distributional::dist_normal() # and posterior::rvar(), can be used with the `xdist` / `ydist` aesthetics dist_df %>%   ggplot(aes(y = group, xdist = dist_normal(mean, sd))) +   stat_eye()"},{"path":"http://mjskay.github.io/ggdist/reference/stat_gradientinterval.html","id":null,"dir":"Reference","previous_headings":"","what":"Gradient + interval plot (shortcut stat) — stat_gradientinterval","title":"Gradient + interval plot (shortcut stat) — stat_gradientinterval","text":"Shortcut version stat_slabinterval() geom_slabinterval() creating gradient + interval plots. Roughly equivalent : graphics device supports , recommended use stat fill_type = \"gradient\" (see description parameter). R >= 4.2, support fill_type = \"gradient\" auto-detected based graphics device using.","code":"stat_slabinterval(   aes(     justification = after_stat(0.5),     thickness = after_stat(thickness(1)),     slab_alpha = after_stat(f)   ),   fill_type = \"auto\",   show.legend = c(size = FALSE, slab_alpha = FALSE) )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_gradientinterval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gradient + interval plot (shortcut stat) — stat_gradientinterval","text":"","code":"stat_gradientinterval(   mapping = NULL,   data = NULL,   geom = \"slabinterval\",   position = \"identity\",   ...,   fill_type = \"auto\",   p_limits = c(NA, NA),   density = \"bounded\",   adjust = waiver(),   trim = TRUE,   expand = FALSE,   breaks = waiver(),   align = \"none\",   outline_bars = FALSE,   point_interval = \"median_qi\",   slab_type = NULL,   limits = NULL,   n = 501,   .width = c(0.66, 0.95),   orientation = NA,   na.rm = FALSE,   show.legend = c(size = FALSE, slab_alpha = FALSE),   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_gradientinterval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Gradient + interval plot (shortcut stat) — stat_gradientinterval","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). geom Use override default connection stat_gradientinterval() geom_slabinterval() position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. paired default geom, geom_slabinterval(), include: normalize normalize heights functions input thickness aesthetic. One : \"\": normalize maximum height across data 1. \"panels\": normalize within panels maximum height panel 1. \"xy\": normalize within x/y axis opposite orientation geom maximum height value opposite axis 1. \"groups\": normalize within values opposite axis within group maximum height group 1. \"none\": values taken normalization (probably used functions whose values [0,1], CDFs). comprehensive discussion examples slab scaling normalization, see thickness scale article. interval_size_domain length-2 numeric vector giving minimum maximum values size linewidth aesthetics translated actual sizes intervals drawn according interval_size_range (see documentation argument.) interval_size_range length-2 numeric vector. geom scales raw size aesthetic values drawing interval point sizes, tend thick using default settings scale_size_continuous(), give sizes range c(1, 6). interval_size_domain value indicates input domain raw size values (typically equal value range argument scale_size_continuous() function), interval_size_range indicates desired output range size values (min max actual sizes used draw intervals). time recommended change value argument, may result strange scaling legends; argument holdover earlier versions size aesthetics targeting point interval separately. want adjust size interval points separately, can also use linewidth point_size aesthetics; see sub-geometry-scales. fatten_point multiplicative factor used adjust size point relative size thickest interval line. wish specify point sizes directly, can also use point_size aesthetic scale_point_size_continuous() scale_point_size_discrete(); sizes specified aesthetic adjusted using fatten_point. arrow grid::arrow() giving arrow heads use interval, NULL arrows. subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". fill_type type fill use fill color alpha varies within slab. One : \"segments\": breaks slab geometry segments unique combination fill color alpha value. approach supported graphics devices works well sharp cutoff values, can give ugly results large number unique fill colors used (gradients, like stat_gradientinterval()). \"gradient\": grid::linearGradient() used create smooth gradient fill. works well large numbers unique fill colors, requires R >= 4.1 yet supported graphics devices. writing, png() graphics device type = \"cairo\", svg() device, pdf() device, ragg::agg_png() devices known support option. R < 4.1, option fall back fill_type = \"segments\" message. \"auto\": attempts use fill_type = \"gradient\" support can auto-detected. R >= 4.2, support gradients can auto-detected graphics devices; support detected, option fall back fill_type = \"segments\" (case false negative, fill_type = \"gradient\" can set explicitly). R < 4.2, support gradients auto-detected, always fall back fill_type = \"segments\", case can set fill_type = \"gradient\" explicitly using graphics device support gradients. p_limits Probability limits (vector size 2) used determine lower upper limits theoretical distributions (distributions samples ignore parameter determine limits based limits sample). E.g., c(.001, .999), slab drawn distribution quantile p = .001 quantile p = .999. lower (respectively upper) limit NA, lower (upper) limit minimum (maximum) distribution's support finite, 0.001 (0.999) finite. E.g., p_limits c(NA, NA), gamma distribution effective value p_limits c(0, .999) since gamma distribution defined (0, Inf); whereas normal distribution equivalent c(.001, .999) since normal distribution defined (-Inf, Inf). density Density estimator sample data. One : function takes numeric vector returns list elements x (giving grid points density estimator) y (corresponding densities). ggdist provides family functions following format, including density_unbounded() density_bounded(). format also compatible stats::density(). string giving suffix function name starts \"density_\"; e.g. \"bounded\" [density_bounded()], \"unbounded\" [density_unbounded()], \"histogram\" density_histogram(). Defaults \"bounded\", .e. density_bounded(), estimates bounds data uses bounded density estimator based reflection method. adjust Passed density: bandwidth density estimator sample data adjusted multiplying value. See e.g. density_bounded() information. Default (waiver()) defers default density estimator, usually 1. trim sample data, density estimate trimmed range data? Passed density estimator; see density parameter. Default TRUE. expand sample data, slab expanded limits scale? Default FALSE. Can length two control expansion lower upper limit respectively. breaks Determines breakpoints defining bins. Defaults \"Scott\". Similar (exactly ) breaks argument graphics::hist(). One : scalar (length-1) numeric giving number bins vector numeric giving breakpoints histogram bins function taking x weights returning either number bins vector breakpoints string giving suffix function starts \"breaks_\". ggdist provides weighted implementations \"Sturges\", \"Scott\", \"FD\" break-finding algorithms graphics::hist(), well breaks_fixed() manually setting bin width. See breaks. example, breaks = \"Sturges\" use breaks_Sturges() algorithm, breaks = 9 create 9 bins, breaks = breaks_fixed(width = 1) set bin width 1. align Determines align breakpoints defining bins. Default (\"none\") performs alignment. One : scalar (length-1) numeric giving offset subtracted breaks. offset must 0 bin width. function taking sorted vector breaks (bin edges) returning offset subtract breaks. string giving suffix function starts \"align_\" used determine alignment, align_none(), align_boundary(), align_center(). example, align = \"none\" provide alignment, align = align_center(= 0) center bin 0, align = align_boundary(= 0) align bin edge 0. outline_bars sample data (density \"histogram\") discrete analytical distributions (whose slabs drawn histograms), determines outlines bars drawn slab_color aesthetic used. FALSE (default), outline drawn along tops bars; TRUE, outlines bars also drawn. See density_histogram(). point_interval function point_interval() family (e.g., median_qi, mean_qi, mode_hdi, etc), string giving name function family (e.g., \"median_qi\", \"mean_qi\", \"mode_hdi\", etc; string, caller's environment searched function, followed ggdist environment). function determines point summary (typically mean, median, mode) interval type (quantile interval, qi; highest-density interval, hdi; highest-density continuous interval, hdci). Output converted appropriate x- y-based aesthetics depending value orientation. See point_interval() family functions information. slab_type (deprecated) type slab function calculate: probability density (mass) function (\"pdf\"), cumulative distribution function (\"cdf\"), complementary CDF (\"ccdf\"). Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf,  1 - cdf) directly onto desired aesthetic. limits Manually-specified limits slab, vector length two. limits combined computed based p_limits well limits defined scales plot determine limits used draw slab functions: limits specify maximal limits; .e., specified, limits wider (may narrower). Use NA leave limit alone; e.g. limits = c(0, NA) ensure lower limit go 0, let upper limit determined either p_limits scale settings. n Number points evaluate function defines slab. .width .width argument passed point_interval: vector probabilities use determine widths resulting intervals. multiple probabilities provided, multiple intervals per group generated, different probability interval (value corresponding .width level generated variables). orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend layer included legends? Default c(size = FALSE), unlike geoms, match common use cases. FALSE hides legends, TRUE shows legends, NA shows mapped (default geoms). inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_gradientinterval.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Gradient + interval plot (shortcut stat) — stat_gradientinterval","text":"ggplot2::Stat representing gradient + interval geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_gradientinterval.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Gradient + interval plot (shortcut stat) — stat_gradientinterval","text":"visualize sample data, data distribution, samples bootstrap distribution, Bayesian posterior, can supply samples x y aesthetic. visualize analytical distributions, can use xdist ydist aesthetic. historical reasons, can also use dist specify distribution, though recommended work well orientation detection. aesthetics can used follows: xdist, ydist, dist can distribution object distributional package (dist_normal(), dist_beta(), etc) can posterior::rvar() object. Since functions vectorized, columns can passed directly aes() specification; e.g. aes(dist = dist_normal(mu, sigma)) work mu sigma columns input data frame. dist can character vector giving distribution name.  arg1, ... arg9 aesthetics (args list column) specify distribution arguments. Distribution names correspond R functions \"p\", \"q\", \"d\" functions; e.g. \"norm\" valid distribution name R defines pnorm(), qnorm(), dnorm() functions Normal distributions. See parse_dist() function useful way generate dist args values human-readable distribution specs (like \"normal(0,1)\"). specs also produced packages (like brms::get_prior function brms); thus, parse_dist() combined stats described can help visualize output functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_gradientinterval.html","id":"computed-variables","dir":"Reference","previous_headings":"","what":"Computed Variables","title":"Gradient + interval plot (shortcut stat) — stat_gradientinterval","text":"following variables computed stat made available use aesthetic specifications (aes()) using after_stat() function after_stat argument stage(): x y: slabs, input values slab function. intervals, point summary interval function. Whether x y depends orientation xmin ymin: intervals, lower end interval interval function. xmax ymax: intervals, upper end interval interval function. .width: intervals, interval width numeric value [0, 1]. slabs, width smallest interval containing value slab. level: intervals, interval width ordered factor. slabs, level smallest interval containing value slab. pdf: slabs, probability density function (PDF). options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, PDF point summary; intervals also pdf_min pdf_max PDF lower upper ends interval. cdf: slabs, cumulative distribution function. options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, CDF point summary; intervals also cdf_min cdf_max CDF lower upper ends interval. n: slabs, number data points summarized slab. slab created analytical distribution via xdist, ydist, dist aesthetic, n Inf. f: (deprecated) slabs, output values slab function (PDF, CDF, CCDF), determined slab_type. Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf, 1 - cdf) directly onto desired aesthetic.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_gradientinterval.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Gradient + interval plot (shortcut stat) — stat_gradientinterval","text":"slab+interval stats geoms wide variety aesthetics control appearance three sub-geometries: slab, point, interval. stats support following aesthetics: x: x position geometry (orientation = \"vertical\"); sample data summarized (orientation = \"horizontal\" sample data). y: y position geometry (orientation = \"horizontal\"); sample data summarized (orientation = \"vertical\" sample data). weight: using samples (.e. x y aesthetics, xdist ydist), optional weights applied draw. xdist: using analytical distributions, distribution map x axis: distributional object (e.g. dist_normal()) posterior::rvar() object. ydist: using analytical distributions, distribution map y axis: distributional object (e.g. dist_normal()) posterior::rvar() object. dist: using analytical distributions, name distribution (e.g. \"norm\"), distributional object (e.g. dist_normal()), posterior::rvar() object. See Details. args: Distribution arguments (args arg1, ... arg9). See Details. addition, default configuration (paired geom_slabinterval()) following aesthetics supported underlying geom: Slab-specific aesthetics thickness: thickness slab x value (orientation = \"horizontal\") y value (orientation = \"vertical\") slab. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. justification: Justification interval relative slab, 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). justification NULL (default), set automatically based value side: side \"top\"/\"right\" justification set 0, side \"bottom\"/\"left\" justification set 1, side \"\" justification set 0.5. datatype: using composite geoms directly without stat (e.g. geom_slabinterval()), datatype used indicate part geom row data targets: rows datatype = \"slab\" target slab portion geometry rows datatype = \"interval\" target interval portion geometry. set automatically using ggdist stats. Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Point-specific aesthetics shape: Shape type used draw point sub-geometry. Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Slab-specific color line override aesthetics slab_fill: Override fill: fill color slab. slab_colour: (slab_color) Override colour/color: outline color slab. slab_alpha: Override alpha: opacity slab. slab_linewidth: Override linwidth: width outline slab. slab_linetype: Override linetype: line type outline slab. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Point-specific color line override aesthetics point_fill: Override fill: fill color point. point_colour: (point_color) Override colour/color: outline color point. point_alpha: Override alpha: opacity point. point_size: Override size: size point. Deprecated aesthetics slab_size: Use slab_linewidth. interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"slabinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/stat_gradientinterval.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Gradient + interval plot (shortcut stat) — stat_gradientinterval","text":"","code":"library(dplyr) library(ggplot2) library(distributional)  theme_set(theme_ggdist())  # ON SAMPLE DATA set.seed(1234) df = data.frame(   group = c(\"a\", \"b\", \"c\"),   value = rnorm(1500, mean = c(5, 7, 9), sd = c(1, 1.5, 1)) ) df %>%   ggplot(aes(x = value, y = group)) +   stat_gradientinterval()   # ON ANALYTICAL DISTRIBUTIONS dist_df = data.frame(   group = c(\"a\", \"b\", \"c\"),   mean =  c(  5,   7,   8),   sd =    c(  1, 1.5,   1) ) # Vectorized distribution types, like distributional::dist_normal() # and posterior::rvar(), can be used with the `xdist` / `ydist` aesthetics dist_df %>%   ggplot(aes(y = group, xdist = dist_normal(mean, sd))) +   stat_gradientinterval()"},{"path":"http://mjskay.github.io/ggdist/reference/stat_halfeye.html","id":null,"dir":"Reference","previous_headings":"","what":"Half-eye (density + interval) plot (shortcut stat) — stat_halfeye","title":"Half-eye (density + interval) plot (shortcut stat) — stat_halfeye","text":"Equivalent stat_slabinterval(), whose default settings create half-eye (density + interval) plots.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_halfeye.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Half-eye (density + interval) plot (shortcut stat) — stat_halfeye","text":"","code":"stat_halfeye(   mapping = NULL,   data = NULL,   geom = \"slabinterval\",   position = \"identity\",   ...,   p_limits = c(NA, NA),   density = \"bounded\",   adjust = waiver(),   trim = TRUE,   expand = FALSE,   breaks = waiver(),   align = \"none\",   outline_bars = FALSE,   point_interval = \"median_qi\",   slab_type = NULL,   limits = NULL,   n = 501,   .width = c(0.66, 0.95),   orientation = NA,   na.rm = FALSE,   show.legend = c(size = FALSE),   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_halfeye.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Half-eye (density + interval) plot (shortcut stat) — stat_halfeye","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). geom Use override default connection stat_halfeye() geom_slabinterval() position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. paired default geom, geom_slabinterval(), include: normalize normalize heights functions input thickness aesthetic. One : \"\": normalize maximum height across data 1. \"panels\": normalize within panels maximum height panel 1. \"xy\": normalize within x/y axis opposite orientation geom maximum height value opposite axis 1. \"groups\": normalize within values opposite axis within group maximum height group 1. \"none\": values taken normalization (probably used functions whose values [0,1], CDFs). comprehensive discussion examples slab scaling normalization, see thickness scale article. fill_type type fill use fill color alpha varies within slab. One : \"segments\": breaks slab geometry segments unique combination fill color alpha value. approach supported graphics devices works well sharp cutoff values, can give ugly results large number unique fill colors used (gradients, like stat_gradientinterval()). \"gradient\": grid::linearGradient() used create smooth gradient fill. works well large numbers unique fill colors, requires R >= 4.1 yet supported graphics devices. writing, png() graphics device type = \"cairo\", svg() device, pdf() device, ragg::agg_png() devices known support option. R < 4.1, option fall back fill_type = \"segments\" message. \"auto\": attempts use fill_type = \"gradient\" support can auto-detected. R >= 4.2, support gradients can auto-detected graphics devices; support detected, option fall back fill_type = \"segments\" (case false negative, fill_type = \"gradient\" can set explicitly). R < 4.2, support gradients auto-detected, always fall back fill_type = \"segments\", case can set fill_type = \"gradient\" explicitly using graphics device support gradients. interval_size_domain length-2 numeric vector giving minimum maximum values size linewidth aesthetics translated actual sizes intervals drawn according interval_size_range (see documentation argument.) interval_size_range length-2 numeric vector. geom scales raw size aesthetic values drawing interval point sizes, tend thick using default settings scale_size_continuous(), give sizes range c(1, 6). interval_size_domain value indicates input domain raw size values (typically equal value range argument scale_size_continuous() function), interval_size_range indicates desired output range size values (min max actual sizes used draw intervals). time recommended change value argument, may result strange scaling legends; argument holdover earlier versions size aesthetics targeting point interval separately. want adjust size interval points separately, can also use linewidth point_size aesthetics; see sub-geometry-scales. fatten_point multiplicative factor used adjust size point relative size thickest interval line. wish specify point sizes directly, can also use point_size aesthetic scale_point_size_continuous() scale_point_size_discrete(); sizes specified aesthetic adjusted using fatten_point. arrow grid::arrow() giving arrow heads use interval, NULL arrows. subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". p_limits Probability limits (vector size 2) used determine lower upper limits theoretical distributions (distributions samples ignore parameter determine limits based limits sample). E.g., c(.001, .999), slab drawn distribution quantile p = .001 quantile p = .999. lower (respectively upper) limit NA, lower (upper) limit minimum (maximum) distribution's support finite, 0.001 (0.999) finite. E.g., p_limits c(NA, NA), gamma distribution effective value p_limits c(0, .999) since gamma distribution defined (0, Inf); whereas normal distribution equivalent c(.001, .999) since normal distribution defined (-Inf, Inf). density Density estimator sample data. One : function takes numeric vector returns list elements x (giving grid points density estimator) y (corresponding densities). ggdist provides family functions following format, including density_unbounded() density_bounded(). format also compatible stats::density(). string giving suffix function name starts \"density_\"; e.g. \"bounded\" [density_bounded()], \"unbounded\" [density_unbounded()], \"histogram\" density_histogram(). Defaults \"bounded\", .e. density_bounded(), estimates bounds data uses bounded density estimator based reflection method. adjust Passed density: bandwidth density estimator sample data adjusted multiplying value. See e.g. density_bounded() information. Default (waiver()) defers default density estimator, usually 1. trim sample data, density estimate trimmed range data? Passed density estimator; see density parameter. Default TRUE. expand sample data, slab expanded limits scale? Default FALSE. Can length two control expansion lower upper limit respectively. breaks Determines breakpoints defining bins. Defaults \"Scott\". Similar (exactly ) breaks argument graphics::hist(). One : scalar (length-1) numeric giving number bins vector numeric giving breakpoints histogram bins function taking x weights returning either number bins vector breakpoints string giving suffix function starts \"breaks_\". ggdist provides weighted implementations \"Sturges\", \"Scott\", \"FD\" break-finding algorithms graphics::hist(), well breaks_fixed() manually setting bin width. See breaks. example, breaks = \"Sturges\" use breaks_Sturges() algorithm, breaks = 9 create 9 bins, breaks = breaks_fixed(width = 1) set bin width 1. align Determines align breakpoints defining bins. Default (\"none\") performs alignment. One : scalar (length-1) numeric giving offset subtracted breaks. offset must 0 bin width. function taking sorted vector breaks (bin edges) returning offset subtract breaks. string giving suffix function starts \"align_\" used determine alignment, align_none(), align_boundary(), align_center(). example, align = \"none\" provide alignment, align = align_center(= 0) center bin 0, align = align_boundary(= 0) align bin edge 0. outline_bars sample data (density \"histogram\") discrete analytical distributions (whose slabs drawn histograms), determines outlines bars drawn slab_color aesthetic used. FALSE (default), outline drawn along tops bars; TRUE, outlines bars also drawn. See density_histogram(). point_interval function point_interval() family (e.g., median_qi, mean_qi, mode_hdi, etc), string giving name function family (e.g., \"median_qi\", \"mean_qi\", \"mode_hdi\", etc; string, caller's environment searched function, followed ggdist environment). function determines point summary (typically mean, median, mode) interval type (quantile interval, qi; highest-density interval, hdi; highest-density continuous interval, hdci). Output converted appropriate x- y-based aesthetics depending value orientation. See point_interval() family functions information. slab_type (deprecated) type slab function calculate: probability density (mass) function (\"pdf\"), cumulative distribution function (\"cdf\"), complementary CDF (\"ccdf\"). Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf,  1 - cdf) directly onto desired aesthetic. limits Manually-specified limits slab, vector length two. limits combined computed based p_limits well limits defined scales plot determine limits used draw slab functions: limits specify maximal limits; .e., specified, limits wider (may narrower). Use NA leave limit alone; e.g. limits = c(0, NA) ensure lower limit go 0, let upper limit determined either p_limits scale settings. n Number points evaluate function defines slab. .width .width argument passed point_interval: vector probabilities use determine widths resulting intervals. multiple probabilities provided, multiple intervals per group generated, different probability interval (value corresponding .width level generated variables). orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend layer included legends? Default c(size = FALSE), unlike geoms, match common use cases. FALSE hides legends, TRUE shows legends, NA shows mapped (default geoms). inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_halfeye.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Half-eye (density + interval) plot (shortcut stat) — stat_halfeye","text":"ggplot2::Stat representing half-eye (density + interval) geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_halfeye.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Half-eye (density + interval) plot (shortcut stat) — stat_halfeye","text":"visualize sample data, data distribution, samples bootstrap distribution, Bayesian posterior, can supply samples x y aesthetic. visualize analytical distributions, can use xdist ydist aesthetic. historical reasons, can also use dist specify distribution, though recommended work well orientation detection. aesthetics can used follows: xdist, ydist, dist can distribution object distributional package (dist_normal(), dist_beta(), etc) can posterior::rvar() object. Since functions vectorized, columns can passed directly aes() specification; e.g. aes(dist = dist_normal(mu, sigma)) work mu sigma columns input data frame. dist can character vector giving distribution name.  arg1, ... arg9 aesthetics (args list column) specify distribution arguments. Distribution names correspond R functions \"p\", \"q\", \"d\" functions; e.g. \"norm\" valid distribution name R defines pnorm(), qnorm(), dnorm() functions Normal distributions. See parse_dist() function useful way generate dist args values human-readable distribution specs (like \"normal(0,1)\"). specs also produced packages (like brms::get_prior function brms); thus, parse_dist() combined stats described can help visualize output functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_halfeye.html","id":"computed-variables","dir":"Reference","previous_headings":"","what":"Computed Variables","title":"Half-eye (density + interval) plot (shortcut stat) — stat_halfeye","text":"following variables computed stat made available use aesthetic specifications (aes()) using after_stat() function after_stat argument stage(): x y: slabs, input values slab function. intervals, point summary interval function. Whether x y depends orientation xmin ymin: intervals, lower end interval interval function. xmax ymax: intervals, upper end interval interval function. .width: intervals, interval width numeric value [0, 1]. slabs, width smallest interval containing value slab. level: intervals, interval width ordered factor. slabs, level smallest interval containing value slab. pdf: slabs, probability density function (PDF). options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, PDF point summary; intervals also pdf_min pdf_max PDF lower upper ends interval. cdf: slabs, cumulative distribution function. options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, CDF point summary; intervals also cdf_min cdf_max CDF lower upper ends interval. n: slabs, number data points summarized slab. slab created analytical distribution via xdist, ydist, dist aesthetic, n Inf. f: (deprecated) slabs, output values slab function (PDF, CDF, CCDF), determined slab_type. Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf, 1 - cdf) directly onto desired aesthetic.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_halfeye.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Half-eye (density + interval) plot (shortcut stat) — stat_halfeye","text":"slab+interval stats geoms wide variety aesthetics control appearance three sub-geometries: slab, point, interval. stats support following aesthetics: x: x position geometry (orientation = \"vertical\"); sample data summarized (orientation = \"horizontal\" sample data). y: y position geometry (orientation = \"horizontal\"); sample data summarized (orientation = \"vertical\" sample data). weight: using samples (.e. x y aesthetics, xdist ydist), optional weights applied draw. xdist: using analytical distributions, distribution map x axis: distributional object (e.g. dist_normal()) posterior::rvar() object. ydist: using analytical distributions, distribution map y axis: distributional object (e.g. dist_normal()) posterior::rvar() object. dist: using analytical distributions, name distribution (e.g. \"norm\"), distributional object (e.g. dist_normal()), posterior::rvar() object. See Details. args: Distribution arguments (args arg1, ... arg9). See Details. addition, default configuration (paired geom_slabinterval()) following aesthetics supported underlying geom: Slab-specific aesthetics thickness: thickness slab x value (orientation = \"horizontal\") y value (orientation = \"vertical\") slab. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. justification: Justification interval relative slab, 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). justification NULL (default), set automatically based value side: side \"top\"/\"right\" justification set 0, side \"bottom\"/\"left\" justification set 1, side \"\" justification set 0.5. datatype: using composite geoms directly without stat (e.g. geom_slabinterval()), datatype used indicate part geom row data targets: rows datatype = \"slab\" target slab portion geometry rows datatype = \"interval\" target interval portion geometry. set automatically using ggdist stats. Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Point-specific aesthetics shape: Shape type used draw point sub-geometry. Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Slab-specific color line override aesthetics slab_fill: Override fill: fill color slab. slab_colour: (slab_color) Override colour/color: outline color slab. slab_alpha: Override alpha: opacity slab. slab_linewidth: Override linwidth: width outline slab. slab_linetype: Override linetype: line type outline slab. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Point-specific color line override aesthetics point_fill: Override fill: fill color point. point_colour: (point_color) Override colour/color: outline color point. point_alpha: Override alpha: opacity point. point_size: Override size: size point. Deprecated aesthetics slab_size: Use slab_linewidth. interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"slabinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/stat_halfeye.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Half-eye (density + interval) plot (shortcut stat) — stat_halfeye","text":"","code":"library(dplyr) library(ggplot2) library(distributional)  theme_set(theme_ggdist())  # ON SAMPLE DATA set.seed(1234) df = data.frame(   group = c(\"a\", \"b\", \"c\"),   value = rnorm(1500, mean = c(5, 7, 9), sd = c(1, 1.5, 1)) ) df %>%   ggplot(aes(x = value, y = group)) +   stat_halfeye()   # ON ANALYTICAL DISTRIBUTIONS dist_df = data.frame(   group = c(\"a\", \"b\", \"c\"),   mean =  c(  5,   7,   8),   sd =    c(  1, 1.5,   1) ) # Vectorized distribution types, like distributional::dist_normal() # and posterior::rvar(), can be used with the `xdist` / `ydist` aesthetics dist_df %>%   ggplot(aes(y = group, xdist = dist_normal(mean, sd))) +   stat_halfeye()"},{"path":"http://mjskay.github.io/ggdist/reference/stat_histinterval.html","id":null,"dir":"Reference","previous_headings":"","what":"Histogram + interval plot (shortcut stat) — stat_histinterval","title":"Histogram + interval plot (shortcut stat) — stat_histinterval","text":"Shortcut version stat_slabinterval() geom_slabinterval() creating histogram + interval plots. Roughly equivalent :","code":"stat_slabinterval(   density = \"histogram\" )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_histinterval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Histogram + interval plot (shortcut stat) — stat_histinterval","text":"","code":"stat_histinterval(   mapping = NULL,   data = NULL,   geom = \"slabinterval\",   position = \"identity\",   ...,   density = \"histogram\",   p_limits = c(NA, NA),   adjust = waiver(),   trim = TRUE,   expand = FALSE,   breaks = waiver(),   align = \"none\",   outline_bars = FALSE,   point_interval = \"median_qi\",   slab_type = NULL,   limits = NULL,   n = 501,   .width = c(0.66, 0.95),   orientation = NA,   na.rm = FALSE,   show.legend = c(size = FALSE),   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_histinterval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Histogram + interval plot (shortcut stat) — stat_histinterval","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). geom Use override default connection stat_histinterval() geom_slabinterval() position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. paired default geom, geom_slabinterval(), include: normalize normalize heights functions input thickness aesthetic. One : \"\": normalize maximum height across data 1. \"panels\": normalize within panels maximum height panel 1. \"xy\": normalize within x/y axis opposite orientation geom maximum height value opposite axis 1. \"groups\": normalize within values opposite axis within group maximum height group 1. \"none\": values taken normalization (probably used functions whose values [0,1], CDFs). comprehensive discussion examples slab scaling normalization, see thickness scale article. fill_type type fill use fill color alpha varies within slab. One : \"segments\": breaks slab geometry segments unique combination fill color alpha value. approach supported graphics devices works well sharp cutoff values, can give ugly results large number unique fill colors used (gradients, like stat_gradientinterval()). \"gradient\": grid::linearGradient() used create smooth gradient fill. works well large numbers unique fill colors, requires R >= 4.1 yet supported graphics devices. writing, png() graphics device type = \"cairo\", svg() device, pdf() device, ragg::agg_png() devices known support option. R < 4.1, option fall back fill_type = \"segments\" message. \"auto\": attempts use fill_type = \"gradient\" support can auto-detected. R >= 4.2, support gradients can auto-detected graphics devices; support detected, option fall back fill_type = \"segments\" (case false negative, fill_type = \"gradient\" can set explicitly). R < 4.2, support gradients auto-detected, always fall back fill_type = \"segments\", case can set fill_type = \"gradient\" explicitly using graphics device support gradients. interval_size_domain length-2 numeric vector giving minimum maximum values size linewidth aesthetics translated actual sizes intervals drawn according interval_size_range (see documentation argument.) interval_size_range length-2 numeric vector. geom scales raw size aesthetic values drawing interval point sizes, tend thick using default settings scale_size_continuous(), give sizes range c(1, 6). interval_size_domain value indicates input domain raw size values (typically equal value range argument scale_size_continuous() function), interval_size_range indicates desired output range size values (min max actual sizes used draw intervals). time recommended change value argument, may result strange scaling legends; argument holdover earlier versions size aesthetics targeting point interval separately. want adjust size interval points separately, can also use linewidth point_size aesthetics; see sub-geometry-scales. fatten_point multiplicative factor used adjust size point relative size thickest interval line. wish specify point sizes directly, can also use point_size aesthetic scale_point_size_continuous() scale_point_size_discrete(); sizes specified aesthetic adjusted using fatten_point. arrow grid::arrow() giving arrow heads use interval, NULL arrows. subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". density Density estimator sample data. One : function takes numeric vector returns list elements x (giving grid points density estimator) y (corresponding densities). ggdist provides family functions following format, including density_unbounded() density_bounded(). format also compatible stats::density(). string giving suffix function name starts \"density_\"; e.g. \"bounded\" [density_bounded()], \"unbounded\" [density_unbounded()], \"histogram\" density_histogram(). Defaults \"bounded\", .e. density_bounded(), estimates bounds data uses bounded density estimator based reflection method. p_limits Probability limits (vector size 2) used determine lower upper limits theoretical distributions (distributions samples ignore parameter determine limits based limits sample). E.g., c(.001, .999), slab drawn distribution quantile p = .001 quantile p = .999. lower (respectively upper) limit NA, lower (upper) limit minimum (maximum) distribution's support finite, 0.001 (0.999) finite. E.g., p_limits c(NA, NA), gamma distribution effective value p_limits c(0, .999) since gamma distribution defined (0, Inf); whereas normal distribution equivalent c(.001, .999) since normal distribution defined (-Inf, Inf). adjust Passed density: bandwidth density estimator sample data adjusted multiplying value. See e.g. density_bounded() information. Default (waiver()) defers default density estimator, usually 1. trim sample data, density estimate trimmed range data? Passed density estimator; see density parameter. Default TRUE. expand sample data, slab expanded limits scale? Default FALSE. Can length two control expansion lower upper limit respectively. breaks Determines breakpoints defining bins. Defaults \"Scott\". Similar (exactly ) breaks argument graphics::hist(). One : scalar (length-1) numeric giving number bins vector numeric giving breakpoints histogram bins function taking x weights returning either number bins vector breakpoints string giving suffix function starts \"breaks_\". ggdist provides weighted implementations \"Sturges\", \"Scott\", \"FD\" break-finding algorithms graphics::hist(), well breaks_fixed() manually setting bin width. See breaks. example, breaks = \"Sturges\" use breaks_Sturges() algorithm, breaks = 9 create 9 bins, breaks = breaks_fixed(width = 1) set bin width 1. align Determines align breakpoints defining bins. Default (\"none\") performs alignment. One : scalar (length-1) numeric giving offset subtracted breaks. offset must 0 bin width. function taking sorted vector breaks (bin edges) returning offset subtract breaks. string giving suffix function starts \"align_\" used determine alignment, align_none(), align_boundary(), align_center(). example, align = \"none\" provide alignment, align = align_center(= 0) center bin 0, align = align_boundary(= 0) align bin edge 0. outline_bars sample data (density \"histogram\") discrete analytical distributions (whose slabs drawn histograms), determines outlines bars drawn slab_color aesthetic used. FALSE (default), outline drawn along tops bars; TRUE, outlines bars also drawn. See density_histogram(). point_interval function point_interval() family (e.g., median_qi, mean_qi, mode_hdi, etc), string giving name function family (e.g., \"median_qi\", \"mean_qi\", \"mode_hdi\", etc; string, caller's environment searched function, followed ggdist environment). function determines point summary (typically mean, median, mode) interval type (quantile interval, qi; highest-density interval, hdi; highest-density continuous interval, hdci). Output converted appropriate x- y-based aesthetics depending value orientation. See point_interval() family functions information. slab_type (deprecated) type slab function calculate: probability density (mass) function (\"pdf\"), cumulative distribution function (\"cdf\"), complementary CDF (\"ccdf\"). Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf,  1 - cdf) directly onto desired aesthetic. limits Manually-specified limits slab, vector length two. limits combined computed based p_limits well limits defined scales plot determine limits used draw slab functions: limits specify maximal limits; .e., specified, limits wider (may narrower). Use NA leave limit alone; e.g. limits = c(0, NA) ensure lower limit go 0, let upper limit determined either p_limits scale settings. n Number points evaluate function defines slab. .width .width argument passed point_interval: vector probabilities use determine widths resulting intervals. multiple probabilities provided, multiple intervals per group generated, different probability interval (value corresponding .width level generated variables). orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend layer included legends? Default c(size = FALSE), unlike geoms, match common use cases. FALSE hides legends, TRUE shows legends, NA shows mapped (default geoms). inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_histinterval.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Histogram + interval plot (shortcut stat) — stat_histinterval","text":"ggplot2::Stat representing histogram + interval geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_histinterval.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Histogram + interval plot (shortcut stat) — stat_histinterval","text":"visualize sample data, data distribution, samples bootstrap distribution, Bayesian posterior, can supply samples x y aesthetic. visualize analytical distributions, can use xdist ydist aesthetic. historical reasons, can also use dist specify distribution, though recommended work well orientation detection. aesthetics can used follows: xdist, ydist, dist can distribution object distributional package (dist_normal(), dist_beta(), etc) can posterior::rvar() object. Since functions vectorized, columns can passed directly aes() specification; e.g. aes(dist = dist_normal(mu, sigma)) work mu sigma columns input data frame. dist can character vector giving distribution name.  arg1, ... arg9 aesthetics (args list column) specify distribution arguments. Distribution names correspond R functions \"p\", \"q\", \"d\" functions; e.g. \"norm\" valid distribution name R defines pnorm(), qnorm(), dnorm() functions Normal distributions. See parse_dist() function useful way generate dist args values human-readable distribution specs (like \"normal(0,1)\"). specs also produced packages (like brms::get_prior function brms); thus, parse_dist() combined stats described can help visualize output functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_histinterval.html","id":"computed-variables","dir":"Reference","previous_headings":"","what":"Computed Variables","title":"Histogram + interval plot (shortcut stat) — stat_histinterval","text":"following variables computed stat made available use aesthetic specifications (aes()) using after_stat() function after_stat argument stage(): x y: slabs, input values slab function. intervals, point summary interval function. Whether x y depends orientation xmin ymin: intervals, lower end interval interval function. xmax ymax: intervals, upper end interval interval function. .width: intervals, interval width numeric value [0, 1]. slabs, width smallest interval containing value slab. level: intervals, interval width ordered factor. slabs, level smallest interval containing value slab. pdf: slabs, probability density function (PDF). options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, PDF point summary; intervals also pdf_min pdf_max PDF lower upper ends interval. cdf: slabs, cumulative distribution function. options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, CDF point summary; intervals also cdf_min cdf_max CDF lower upper ends interval. n: slabs, number data points summarized slab. slab created analytical distribution via xdist, ydist, dist aesthetic, n Inf. f: (deprecated) slabs, output values slab function (PDF, CDF, CCDF), determined slab_type. Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf, 1 - cdf) directly onto desired aesthetic.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_histinterval.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Histogram + interval plot (shortcut stat) — stat_histinterval","text":"slab+interval stats geoms wide variety aesthetics control appearance three sub-geometries: slab, point, interval. stats support following aesthetics: x: x position geometry (orientation = \"vertical\"); sample data summarized (orientation = \"horizontal\" sample data). y: y position geometry (orientation = \"horizontal\"); sample data summarized (orientation = \"vertical\" sample data). weight: using samples (.e. x y aesthetics, xdist ydist), optional weights applied draw. xdist: using analytical distributions, distribution map x axis: distributional object (e.g. dist_normal()) posterior::rvar() object. ydist: using analytical distributions, distribution map y axis: distributional object (e.g. dist_normal()) posterior::rvar() object. dist: using analytical distributions, name distribution (e.g. \"norm\"), distributional object (e.g. dist_normal()), posterior::rvar() object. See Details. args: Distribution arguments (args arg1, ... arg9). See Details. addition, default configuration (paired geom_slabinterval()) following aesthetics supported underlying geom: Slab-specific aesthetics thickness: thickness slab x value (orientation = \"horizontal\") y value (orientation = \"vertical\") slab. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. justification: Justification interval relative slab, 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). justification NULL (default), set automatically based value side: side \"top\"/\"right\" justification set 0, side \"bottom\"/\"left\" justification set 1, side \"\" justification set 0.5. datatype: using composite geoms directly without stat (e.g. geom_slabinterval()), datatype used indicate part geom row data targets: rows datatype = \"slab\" target slab portion geometry rows datatype = \"interval\" target interval portion geometry. set automatically using ggdist stats. Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Point-specific aesthetics shape: Shape type used draw point sub-geometry. Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Slab-specific color line override aesthetics slab_fill: Override fill: fill color slab. slab_colour: (slab_color) Override colour/color: outline color slab. slab_alpha: Override alpha: opacity slab. slab_linewidth: Override linwidth: width outline slab. slab_linetype: Override linetype: line type outline slab. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Point-specific color line override aesthetics point_fill: Override fill: fill color point. point_colour: (point_color) Override colour/color: outline color point. point_alpha: Override alpha: opacity point. point_size: Override size: size point. Deprecated aesthetics slab_size: Use slab_linewidth. interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"slabinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/stat_histinterval.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Histogram + interval plot (shortcut stat) — stat_histinterval","text":"","code":"library(dplyr) library(ggplot2) library(distributional)  theme_set(theme_ggdist())  # ON SAMPLE DATA set.seed(1234) df = data.frame(   group = c(\"a\", \"b\", \"c\"),   value = rnorm(1500, mean = c(5, 7, 9), sd = c(1, 1.5, 1)) ) df %>%   ggplot(aes(x = value, y = group)) +   stat_histinterval()   # ON ANALYTICAL DISTRIBUTIONS dist_df = data.frame(   group = c(\"a\", \"b\", \"c\"),   mean =  c(  5,   7,   8),   sd =    c(  1, 1.5,   1) ) # Vectorized distribution types, like distributional::dist_normal() # and posterior::rvar(), can be used with the `xdist` / `ydist` aesthetics dist_df %>%   ggplot(aes(y = group, xdist = dist_normal(mean, sd))) +   stat_histinterval()"},{"path":"http://mjskay.github.io/ggdist/reference/stat_interval.html","id":null,"dir":"Reference","previous_headings":"","what":"Multiple-interval plot (shortcut stat) — stat_interval","title":"Multiple-interval plot (shortcut stat) — stat_interval","text":"Shortcut version stat_slabinterval() geom_interval() creating multiple-interval plots. Roughly equivalent :","code":"stat_slabinterval(   aes(     colour = after_stat(level),     size = NULL   ),   geom = \"interval\",   show_point = FALSE,   .width = c(0.5, 0.8, 0.95),   show_slab = FALSE,   show.legend = NA )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_interval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Multiple-interval plot (shortcut stat) — stat_interval","text":"","code":"stat_interval(   mapping = NULL,   data = NULL,   geom = \"interval\",   position = \"identity\",   ...,   .width = c(0.5, 0.8, 0.95),   point_interval = \"median_qi\",   orientation = NA,   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_interval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Multiple-interval plot (shortcut stat) — stat_interval","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). geom Use override default connection stat_interval() geom_interval() position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. paired default geom, geom_interval(), include: interval_size_range length-2 numeric vector. geom scales raw size aesthetic values drawing interval point sizes, tend thick using default settings scale_size_continuous(), give sizes range c(1, 6). interval_size_domain value indicates input domain raw size values (typically equal value range argument scale_size_continuous() function), interval_size_range indicates desired output range size values (min max actual sizes used draw intervals). time recommended change value argument, may result strange scaling legends; argument holdover earlier versions size aesthetics targeting point interval separately. want adjust size interval points separately, can also use linewidth point_size aesthetics; see sub-geometry-scales. interval_size_domain length-2 numeric vector giving minimum maximum values size linewidth aesthetics translated actual sizes intervals drawn according interval_size_range (see documentation argument.) arrow grid::arrow() giving arrow heads use interval, NULL arrows. .width .width argument passed point_interval: vector probabilities use determine widths resulting intervals. multiple probabilities provided, multiple intervals per group generated, different probability interval (value corresponding .width level generated variables). point_interval function point_interval() family (e.g., median_qi, mean_qi, mode_hdi, etc), string giving name function family (e.g., \"median_qi\", \"mean_qi\", \"mode_hdi\", etc; string, caller's environment searched function, followed ggdist environment). function determines point summary (typically mean, median, mode) interval type (quantile interval, qi; highest-density interval, hdi; highest-density continuous interval, hdci). Output converted appropriate x- y-based aesthetics depending value orientation. See point_interval() family functions information. orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend layer included legends? Default c(size = FALSE), unlike geoms, match common use cases. FALSE hides legends, TRUE shows legends, NA shows mapped (default geoms). inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_interval.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Multiple-interval plot (shortcut stat) — stat_interval","text":"ggplot2::Stat representing multiple-interval geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_interval.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Multiple-interval plot (shortcut stat) — stat_interval","text":"visualize sample data, data distribution, samples bootstrap distribution, Bayesian posterior, can supply samples x y aesthetic. visualize analytical distributions, can use xdist ydist aesthetic. historical reasons, can also use dist specify distribution, though recommended work well orientation detection. aesthetics can used follows: xdist, ydist, dist can distribution object distributional package (dist_normal(), dist_beta(), etc) can posterior::rvar() object. Since functions vectorized, columns can passed directly aes() specification; e.g. aes(dist = dist_normal(mu, sigma)) work mu sigma columns input data frame. dist can character vector giving distribution name.  arg1, ... arg9 aesthetics (args list column) specify distribution arguments. Distribution names correspond R functions \"p\", \"q\", \"d\" functions; e.g. \"norm\" valid distribution name R defines pnorm(), qnorm(), dnorm() functions Normal distributions. See parse_dist() function useful way generate dist args values human-readable distribution specs (like \"normal(0,1)\"). specs also produced packages (like brms::get_prior function brms); thus, parse_dist() combined stats described can help visualize output functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_interval.html","id":"computed-variables","dir":"Reference","previous_headings":"","what":"Computed Variables","title":"Multiple-interval plot (shortcut stat) — stat_interval","text":"following variables computed stat made available use aesthetic specifications (aes()) using after_stat() function after_stat argument stage(): x y: slabs, input values slab function. intervals, point summary interval function. Whether x y depends orientation xmin ymin: intervals, lower end interval interval function. xmax ymax: intervals, upper end interval interval function. .width: intervals, interval width numeric value [0, 1]. slabs, width smallest interval containing value slab. level: intervals, interval width ordered factor. slabs, level smallest interval containing value slab. pdf: slabs, probability density function (PDF). options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, PDF point summary; intervals also pdf_min pdf_max PDF lower upper ends interval. cdf: slabs, cumulative distribution function. options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, CDF point summary; intervals also cdf_min cdf_max CDF lower upper ends interval.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_interval.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Multiple-interval plot (shortcut stat) — stat_interval","text":"slab+interval stats geoms wide variety aesthetics control appearance three sub-geometries: slab, point, interval. stats support following aesthetics: x: x position geometry (orientation = \"vertical\"); sample data summarized (orientation = \"horizontal\" sample data). y: y position geometry (orientation = \"horizontal\"); sample data summarized (orientation = \"vertical\" sample data). weight: using samples (.e. x y aesthetics, xdist ydist), optional weights applied draw. xdist: using analytical distributions, distribution map x axis: distributional object (e.g. dist_normal()) posterior::rvar() object. ydist: using analytical distributions, distribution map y axis: distributional object (e.g. dist_normal()) posterior::rvar() object. dist: using analytical distributions, name distribution (e.g. \"norm\"), distributional object (e.g. dist_normal()), posterior::rvar() object. See Details. args: Distribution arguments (args arg1, ... arg9). See Details. addition, default configuration (paired geom_interval()) following aesthetics supported underlying geom: Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Deprecated aesthetics interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"slabinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/stat_interval.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Multiple-interval plot (shortcut stat) — stat_interval","text":"","code":"library(dplyr) library(ggplot2) library(distributional)  theme_set(theme_ggdist())  # ON SAMPLE DATA set.seed(1234) df = data.frame(   group = c(\"a\", \"b\", \"c\"),   value = rnorm(1500, mean = c(5, 7, 9), sd = c(1, 1.5, 1)) ) df %>%   ggplot(aes(x = value, y = group)) +   stat_interval() +   scale_color_brewer()   # ON ANALYTICAL DISTRIBUTIONS dist_df = data.frame(   group = c(\"a\", \"b\", \"c\"),   mean =  c(  5,   7,   8),   sd =    c(  1, 1.5,   1) ) # Vectorized distribution types, like distributional::dist_normal() # and posterior::rvar(), can be used with the `xdist` / `ydist` aesthetics dist_df %>%   ggplot(aes(y = group, xdist = dist_normal(mean, sd))) +   stat_interval() +   scale_color_brewer()"},{"path":"http://mjskay.github.io/ggdist/reference/stat_lineribbon.html","id":null,"dir":"Reference","previous_headings":"","what":"Line + multiple-ribbon plot (shortcut stat) — stat_lineribbon","title":"Line + multiple-ribbon plot (shortcut stat) — stat_lineribbon","text":"combination stat_slabinterval() geom_lineribbon() sensible defaults making line + multiple-ribbon plots. geom_lineribbon() intended use data frames already summarized using point_interval() function, stat_lineribbon() intended use directly data frames draws analytical distributions, perform summarization using point_interval() function. Roughly equivalent :","code":"stat_slabinterval(   aes(     group = after_stat(level),     fill = after_stat(level),     order = after_stat(level),     size = NULL   ),   geom = \"lineribbon\",   .width = c(0.5, 0.8, 0.95),   show_slab = FALSE,   show.legend = NA )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_lineribbon.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Line + multiple-ribbon plot (shortcut stat) — stat_lineribbon","text":"","code":"stat_lineribbon(   mapping = NULL,   data = NULL,   geom = \"lineribbon\",   position = \"identity\",   ...,   .width = c(0.5, 0.8, 0.95),   point_interval = \"median_qi\",   orientation = NA,   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_lineribbon.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Line + multiple-ribbon plot (shortcut stat) — stat_lineribbon","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). geom Use override default connection stat_lineribbon() geom_lineribbon() position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. paired default geom, geom_lineribbon(), include: step line/ribbon drawn step function? One : FALSE (default): draw step function. \"mid\" (TRUE): draw steps midway adjacent x values. \"hv\": draw horizontal--vertical steps. \"vh\": draw vertical--horizontal steps. TRUE alias \"mid\" step function ribbons, \"mid\" probably want (two step approaches ribbons either first last x value visible). .width .width argument passed point_interval: vector probabilities use determine widths resulting intervals. multiple probabilities provided, multiple intervals per group generated, different probability interval (value corresponding .width level generated variables). point_interval function point_interval() family (e.g., median_qi, mean_qi, mode_hdi, etc), string giving name function family (e.g., \"median_qi\", \"mean_qi\", \"mode_hdi\", etc; string, caller's environment searched function, followed ggdist environment). function determines point summary (typically mean, median, mode) interval type (quantile interval, qi; highest-density interval, hdi; highest-density continuous interval, hdci). Output converted appropriate x- y-based aesthetics depending value orientation. See point_interval() family functions information. orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_lineribbon.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Line + multiple-ribbon plot (shortcut stat) — stat_lineribbon","text":"ggplot2::Stat representing line + multiple-ribbon geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_lineribbon.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Line + multiple-ribbon plot (shortcut stat) — stat_lineribbon","text":"visualize sample data, data distribution, samples bootstrap distribution, Bayesian posterior, can supply samples x y aesthetic. visualize analytical distributions, can use xdist ydist aesthetic. historical reasons, can also use dist specify distribution, though recommended work well orientation detection. aesthetics can used follows: xdist, ydist, dist can distribution object distributional package (dist_normal(), dist_beta(), etc) can posterior::rvar() object. Since functions vectorized, columns can passed directly aes() specification; e.g. aes(dist = dist_normal(mu, sigma)) work mu sigma columns input data frame. dist can character vector giving distribution name.  arg1, ... arg9 aesthetics (args list column) specify distribution arguments. Distribution names correspond R functions \"p\", \"q\", \"d\" functions; e.g. \"norm\" valid distribution name R defines pnorm(), qnorm(), dnorm() functions Normal distributions. See parse_dist() function useful way generate dist args values human-readable distribution specs (like \"normal(0,1)\"). specs also produced packages (like brms::get_prior function brms); thus, parse_dist() combined stats described can help visualize output functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_lineribbon.html","id":"computed-variables","dir":"Reference","previous_headings":"","what":"Computed Variables","title":"Line + multiple-ribbon plot (shortcut stat) — stat_lineribbon","text":"following variables computed stat made available use aesthetic specifications (aes()) using after_stat() function after_stat argument stage(): x y: slabs, input values slab function. intervals, point summary interval function. Whether x y depends orientation xmin ymin: intervals, lower end interval interval function. xmax ymax: intervals, upper end interval interval function. .width: intervals, interval width numeric value [0, 1]. slabs, width smallest interval containing value slab. level: intervals, interval width ordered factor. slabs, level smallest interval containing value slab. pdf: slabs, probability density function (PDF). options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, PDF point summary; intervals also pdf_min pdf_max PDF lower upper ends interval. cdf: slabs, cumulative distribution function. options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, CDF point summary; intervals also cdf_min cdf_max CDF lower upper ends interval.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_lineribbon.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Line + multiple-ribbon plot (shortcut stat) — stat_lineribbon","text":"line+ribbon stats geoms wide variety aesthetics control appearance two sub-geometries: line ribbon. stats support following aesthetics: x: x position geometry (orientation = \"vertical\"); sample data summarized (orientation = \"horizontal\" sample data). y: y position geometry (orientation = \"horizontal\"); sample data summarized (orientation = \"vertical\" sample data). weight: using samples (.e. x y aesthetics, xdist ydist), optional weights applied draw. xdist: using analytical distributions, distribution map x axis: distributional object (e.g. dist_normal()) posterior::rvar() object. ydist: using analytical distributions, distribution map y axis: distributional object (e.g. dist_normal()) posterior::rvar() object. dist: using analytical distributions, name distribution (e.g. \"norm\"), distributional object (e.g. dist_normal()), posterior::rvar() object. See Details. args: Distribution arguments (args arg1, ... arg9). See Details. addition, default configuration (paired geom_lineribbon()) following aesthetics supported underlying geom: Ribbon-specific aesthetics xmin: Left edge ribbon sub-geometry (orientation = \"horizontal\"). xmax: Right edge ribbon sub-geometry (orientation = \"horizontal\"). ymin: Lower edge ribbon sub-geometry (orientation = \"vertical\"). ymax: Upper edge ribbon sub-geometry (orientation = \"vertical\"). order: order ribbons drawn. Ribbons smallest mean value order drawn first (.e., drawn ribbons larger mean values order). order supplied geom_lineribbon(), -abs(xmax - xmin) -abs(ymax - ymax) (depending orientation) used, effect drawing widest (average) ribbons bottom. stat_lineribbon() uses order = after_stat(level) default, causing ribbons generated largest .width drawn bottom. Color aesthetics colour: (color) color line sub-geometry. fill: fill color ribbon sub-geometry. alpha: opacity line ribbon sub-geometries. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line. ggplot2 < 3.4, called size. linetype: Type line (e.g., \"solid\", \"dashed\", etc) aesthetics (work standard geoms) group See examples aesthetics action vignette(\"lineribbon\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/stat_lineribbon.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Line + multiple-ribbon plot (shortcut stat) — stat_lineribbon","text":"","code":"library(dplyr) library(ggplot2) library(distributional)  theme_set(theme_ggdist())  # ON SAMPLE DATA set.seed(12345) tibble(   x = rep(1:10, 100),   y = rnorm(1000, x) ) %>%   ggplot(aes(x = x, y = y)) +   stat_lineribbon() +   scale_fill_brewer()   # ON ANALYTICAL DISTRIBUTIONS # Vectorized distribution types, like distributional::dist_normal() # and posterior::rvar(), can be used with the `xdist` / `ydist` aesthetics tibble(   x = 1:10,   sd = seq(1, 3, length.out = 10) ) %>%   ggplot(aes(x = x, ydist = dist_normal(x, sd))) +   stat_lineribbon() +   scale_fill_brewer()"},{"path":"http://mjskay.github.io/ggdist/reference/stat_mcse_dots.html","id":null,"dir":"Reference","previous_headings":"","what":"Blurry MCSE dot plot (stat) — stat_mcse_dots","title":"Blurry MCSE dot plot (stat) — stat_mcse_dots","text":"Variant stat_dots() creating blurry dotplots quantiles. Uses posterior::mcse_quantile() calculate Monte Carlo Standard Error quantile computed dotplot, yielding se computed variable default mapped onto sd aesthetic geom_blur_dots().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_mcse_dots.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Blurry MCSE dot plot (stat) — stat_mcse_dots","text":"","code":"stat_mcse_dots(   mapping = NULL,   data = NULL,   geom = \"blur_dots\",   position = \"identity\",   ...,   quantiles = NA,   orientation = NA,   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_mcse_dots.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Blurry MCSE dot plot (stat) — stat_mcse_dots","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). geom Use override default connection stat_mcse_dots() geom_blur_dots() position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. paired default geom, geom_blur_dots(), include: blur Blur function apply dots. One : function takes numeric vector distances dot center, dot radius, standard deviation blur returns vector opacities \\([0, 1]\\), blur_gaussian() blur_interval(). string indicating blur function use, suffix function name starting blur_; e.g. \"gaussian\" (default) applies blur_gaussian(). binwidth bin width use laying dots. One : NA (default): Dynamically select bin width based size plot drawn. pick binwidth tallest stack dots scale height (ideally exactly scale height, though guaranteed). length-1 (scalar) numeric unit object giving exact bin width. length-2 (vector) numeric unit object giving minimum maximum desired bin width. bin width dynamically selected within bounds. value numeric, assumed units data. bin width (bounds) can also specified using unit(), may useful desired dots certain point size certain percentage width/height viewport. example, unit(0.1, \"npc\") make dots exactly 10% viewport size along whichever dimension dotplot drawn; unit(c(0, 0.1), \"npc\") make dots 10% viewport size (still ensuring tallest stack less equal scale). dotsize width dots relative binwidth. default, 1.07, makes dots just bit wider bin width, manually-tuned parameter tends work well default circular shape, preventing gaps bins appearing large visually (might arise dots precisely binwidth). desired dots precisely binwidth, set dotsize = 1. stackratio distance center dots stack relative dot height. default, 1, makes dots stack just touch . layout layout method used dots: \"bin\" (default): places dots -axis midpoint bins classic Wilkinson dotplot. maintains alignment rows columns dotplot. layout slightly different classic Wilkinson algorithm : (1) nudges bins slightly avoid overlapping bins (2) input data symmetrical return symmetrical layout. \"weave\": uses basic binning approach \"bin\", places dots -axis actual positions (unless overlaps = \"nudge\", case overlaps may nudged way). maintains alignment rows align dots within columns. \"hex\": uses basic binning approach \"bin\", alternates placing dots + binwidth/4 - binwidth/4 -axis bin center. allows hexagonal packing setting stackratio less 1 (something like 0.9 tends work). \"swarm\": uses \"compactswarm\" layout beeswarm::beeswarm(). maintain alignment rows columns, can compact neat looking, especially sample data (opposed quantile dotplots theoretical distributions, may look better \"bin\", \"weave\", \"hex\"). \"bar\": discrete distributions, lays duplicate values rectangular bars. overlaps handle overlapping dots bins \"bin\", \"weave\", \"hex\" layouts (dots never overlap \"swarm\" \"bar\" layouts). purposes argument, dots considered overlapping overlapping dotsize = 1 stackratio = 1; .e. set arguments values, overlaps may still occur. One : \"keep\": leave overlapping dots . Dots may overlap (usually slightly) \"bin\", \"weave\", \"hex\" layouts. \"nudge\": nudge overlapping dots way. Overlaps avoided using constrained optimization minimizes squared distance dots desired positions, subject constraint adjacent dots overlap. smooth Smoother apply dot positions. One : function takes numeric vector dot positions returns smoothed version vector, smooth_bounded(), smooth_unbounded(), smooth_discrete(), smooth_bar()`. string indicating smoother use, suffix function name starting smooth_; e.g. \"none\" (default) applies smooth_none(), simply returns given vector without applying smoothing. Smoothing effective smoother matched support distribution; e.g. using smooth_bounded(bounds = ...). overflow handle overflow dots beyond extent geom minimum binwidth (exact binwidth) supplied. One : \"keep\": Keep overflow, drawing dots outside geom bounds. \"warn\": Keep overflow, produce warning suggesting solutions, setting binwidth = NA overflow = \"compress\". \"compress\": Compress layout. Reduces binwidth size necessary keep dots within bounds, adjusts stackratio dotsize apparent dot size user-specified minimum binwidth times user-specified dotsize. find default layout dots small, okay dots overlapping, consider setting overflow = \"compress\" supplying exact minimum dot size using binwidth. verbose TRUE, print bin width dotplot. Can useful want start automatically-selected bin width adjust manually. Bin width printed data units normalized parent coordinates \"npc\"s (see unit()). Note just want scale selected bin width fit within desired area, probably easier use scale copy scale binwidth manually, just want provide constraints bin width, can pass length-2 vector binwidth. subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". quantiles Setting value NA produce quantile dotplot: , dotplot quantiles sample distribution (analytical distributions, default NA taken mean 100 quantiles). value quantiles determines number quantiles plot. See Kay et al. (2016) Fernandes et al. (2018) information quantile dotplots. orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. can also named logical vector finely select aesthetics display. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_mcse_dots.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Blurry MCSE dot plot (stat) — stat_mcse_dots","text":"ggplot2::Stat representing blurry MCSE dot geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_mcse_dots.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Blurry MCSE dot plot (stat) — stat_mcse_dots","text":"dots family stats geoms similar geom_dotplot() number differences: Dots geoms act like slabs geom_slabinterval() can given x positions (y positions horizontal orientation). Given available space lay dots, dots geoms automatically determine many bins use fit available space. Dots geoms use dynamic layout algorithm lays dots center input data symmetrical, guaranteeing symmetrical data results symmetrical plot. layout algorithm also prevents dots overlapping . shape dots geoms can changed using slab_shape aesthetic (using dotsinterval family) shape slab_shape aesthetic (using dots family) Stats geoms family include: geom_dots(): dotplots raw data. Ensures dotplot fits within available space reducing size dots automatically (may result small dots). geom_swarm() geom_weave(): dotplots raw data defaults intended create \"beeswarm\" plots. Used side = \"\" default, sets default dot size size geom_point() (binwidth = unit(1.5, \"mm\")), allowing dots overlap instead getting small. stat_dots(): dotplots raw data, distributional objects, posterior::rvar()s geom_dotsinterval(): dotplot + interval plots raw data already-calculated intervals (rarely useful directly). stat_dotsinterval(): dotplot + interval plots raw data, distributional objects, posterior::rvar()s (calculate intervals ). geom_blur_dots(): blurry dotplots allow standard deviation blur applied dot specified using sd aesthetic. stat_mcse_dots(): blurry dotplots quantiles using Monte Carlo Standard Error quantile. stat_dots() stat_dotsinterval(), used quantiles argument, particularly useful constructing quantile dotplots, can effective way communicate uncertainty using frequency framing may easier laypeople understand (Kay et al. 2016, Fernandes et al. 2018). visualize sample data, data distribution, samples bootstrap distribution, Bayesian posterior, can supply samples x y aesthetic. visualize analytical distributions, can use xdist ydist aesthetic. historical reasons, can also use dist specify distribution, though recommended work well orientation detection. aesthetics can used follows: xdist, ydist, dist can distribution object distributional package (dist_normal(), dist_beta(), etc) can posterior::rvar() object. Since functions vectorized, columns can passed directly aes() specification; e.g. aes(dist = dist_normal(mu, sigma)) work mu sigma columns input data frame. dist can character vector giving distribution name.  arg1, ... arg9 aesthetics (args list column) specify distribution arguments. Distribution names correspond R functions \"p\", \"q\", \"d\" functions; e.g. \"norm\" valid distribution name R defines pnorm(), qnorm(), dnorm() functions Normal distributions. See parse_dist() function useful way generate dist args values human-readable distribution specs (like \"normal(0,1)\"). specs also produced packages (like brms::get_prior function brms); thus, parse_dist() combined stats described can help visualize output functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_mcse_dots.html","id":"computed-variables","dir":"Reference","previous_headings":"","what":"Computed Variables","title":"Blurry MCSE dot plot (stat) — stat_mcse_dots","text":"following variables computed stat made available use aesthetic specifications (aes()) using after_stat() function after_stat argument stage(): x y: slabs, input values slab function. intervals, point summary interval function. Whether x y depends orientation xmin ymin: intervals, lower end interval interval function. xmax ymax: intervals, upper end interval interval function. .width: intervals, interval width numeric value [0, 1]. slabs, width smallest interval containing value slab. level: intervals, interval width ordered factor. slabs, level smallest interval containing value slab. pdf: slabs, probability density function (PDF). options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, PDF point summary; intervals also pdf_min pdf_max PDF lower upper ends interval. cdf: slabs, cumulative distribution function. options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, CDF point summary; intervals also cdf_min cdf_max CDF lower upper ends interval. n: slabs, number data points summarized slab. slab created analytical distribution via xdist, ydist, dist aesthetic, n Inf. f: (deprecated) slabs, output values slab function (PDF, CDF, CCDF), determined slab_type. Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf, 1 - cdf) directly onto desired aesthetic. se: dots, Monte Carlo Standard Error quantile corresponding dot.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_mcse_dots.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Blurry MCSE dot plot (stat) — stat_mcse_dots","text":"dots+interval stats geoms wide variety aesthetics control appearance three sub-geometries: dots (aka slab), point, interval. stats support following aesthetics: x: x position geometry (orientation = \"vertical\"); sample data summarized (orientation = \"horizontal\" sample data). y: y position geometry (orientation = \"horizontal\"); sample data summarized (orientation = \"vertical\" sample data). weight: using samples (.e. x y aesthetics, xdist ydist), optional weights applied draw. xdist: using analytical distributions, distribution map x axis: distributional object (e.g. dist_normal()) posterior::rvar() object. ydist: using analytical distributions, distribution map y axis: distributional object (e.g. dist_normal()) posterior::rvar() object. dist: using analytical distributions, name distribution (e.g. \"norm\"), distributional object (e.g. dist_normal()), posterior::rvar() object. See Details. args: Distribution arguments (args arg1, ... arg9). See Details. addition, default configuration (paired geom_blur_dots()) following aesthetics supported underlying geom: Dots-specific (aka Slab-specific) aesthetics sd: standard deviation (data units) blur associated dot. order: order data points stacked within bins. Can used create effect \"stacked\" dots ordering dots according discrete variable. omitted (NULL), value data points used determine stacking order. applies layout \"bin\" \"hex\", layout methods fully determine x y positions. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. justification: Justification interval relative slab, 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). justification NULL (default), set automatically based value side: side \"top\"/\"right\" justification set 0, side \"bottom\"/\"left\" justification set 1, side \"\" justification set 0.5. datatype: using composite geoms directly without stat (e.g. geom_slabinterval()), datatype used indicate part geom row data targets: rows datatype = \"slab\" target slab portion geometry rows datatype = \"interval\" target interval portion geometry. set automatically using ggdist stats. Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Slab-specific color line override aesthetics slab_fill: Override fill: fill color slab. slab_colour: (slab_color) Override colour/color: outline color slab. slab_alpha: Override alpha: opacity slab. slab_linewidth: Override linwidth: width outline slab. slab_linetype: Override linetype: line type outline slab. slab_shape: Override shape: shape dots used draw dotplot slab. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Point-specific color line override aesthetics point_fill: Override fill: fill color point. point_colour: (point_color) Override colour/color: outline color point. point_alpha: Override alpha: opacity point. point_size: Override size: size point. Deprecated aesthetics slab_size: Use slab_linewidth. interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"dotsinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_mcse_dots.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Blurry MCSE dot plot (stat) — stat_mcse_dots","text":"Kay, M., Kola, T., Hullman, J. R., & Munson, S. . (2016). (ish) Bus? User-centered Visualizations Uncertainty Everyday, Mobile Predictive Systems. Conference Human Factors Computing Systems - CHI '16, 5092--5103. doi:10.1145/2858036.2858558 . Fernandes, M., Walls, L., Munson, S., Hullman, J., & Kay, M. (2018). Uncertainty Displays Using Quantile Dotplots CDFs Improve Transit Decision-Making. Conference Human Factors Computing Systems - CHI '18. doi:10.1145/3173574.3173718 .","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/stat_mcse_dots.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Blurry MCSE dot plot (stat) — stat_mcse_dots","text":"","code":"library(dplyr) library(ggplot2)  theme_set(theme_ggdist())  set.seed(1234) data.frame(x = rnorm(1000)) %>%   ggplot(aes(x = x)) +   stat_mcse_dots(quantiles = 100, layout = \"weave\")"},{"path":"http://mjskay.github.io/ggdist/reference/stat_pointinterval.html","id":null,"dir":"Reference","previous_headings":"","what":"Point + multiple-interval plot (shortcut stat) — stat_pointinterval","title":"Point + multiple-interval plot (shortcut stat) — stat_pointinterval","text":"Shortcut version stat_slabinterval() geom_pointinterval() creating point + multiple-interval plots. Roughly equivalent :","code":"stat_slabinterval(   geom = \"pointinterval\",   show_slab = FALSE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_pointinterval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Point + multiple-interval plot (shortcut stat) — stat_pointinterval","text":"","code":"stat_pointinterval(   mapping = NULL,   data = NULL,   geom = \"pointinterval\",   position = \"identity\",   ...,   point_interval = \"median_qi\",   .width = c(0.66, 0.95),   orientation = NA,   na.rm = FALSE,   show.legend = c(size = FALSE),   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_pointinterval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Point + multiple-interval plot (shortcut stat) — stat_pointinterval","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). geom Use override default connection stat_pointinterval() geom_pointinterval() position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. paired default geom, geom_pointinterval(), include: interval_size_domain length-2 numeric vector giving minimum maximum values size linewidth aesthetics translated actual sizes intervals drawn according interval_size_range (see documentation argument.) interval_size_range length-2 numeric vector. geom scales raw size aesthetic values drawing interval point sizes, tend thick using default settings scale_size_continuous(), give sizes range c(1, 6). interval_size_domain value indicates input domain raw size values (typically equal value range argument scale_size_continuous() function), interval_size_range indicates desired output range size values (min max actual sizes used draw intervals). time recommended change value argument, may result strange scaling legends; argument holdover earlier versions size aesthetics targeting point interval separately. want adjust size interval points separately, can also use linewidth point_size aesthetics; see sub-geometry-scales. fatten_point multiplicative factor used adjust size point relative size thickest interval line. wish specify point sizes directly, can also use point_size aesthetic scale_point_size_continuous() scale_point_size_discrete(); sizes specified aesthetic adjusted using fatten_point. arrow grid::arrow() giving arrow heads use interval, NULL arrows. point_interval function point_interval() family (e.g., median_qi, mean_qi, mode_hdi, etc), string giving name function family (e.g., \"median_qi\", \"mean_qi\", \"mode_hdi\", etc; string, caller's environment searched function, followed ggdist environment). function determines point summary (typically mean, median, mode) interval type (quantile interval, qi; highest-density interval, hdi; highest-density continuous interval, hdci). Output converted appropriate x- y-based aesthetics depending value orientation. See point_interval() family functions information. .width .width argument passed point_interval: vector probabilities use determine widths resulting intervals. multiple probabilities provided, multiple intervals per group generated, different probability interval (value corresponding .width level generated variables). orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend layer included legends? Default c(size = FALSE), unlike geoms, match common use cases. FALSE hides legends, TRUE shows legends, NA shows mapped (default geoms). inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_pointinterval.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Point + multiple-interval plot (shortcut stat) — stat_pointinterval","text":"ggplot2::Stat representing point + multiple-interval geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_pointinterval.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Point + multiple-interval plot (shortcut stat) — stat_pointinterval","text":"visualize sample data, data distribution, samples bootstrap distribution, Bayesian posterior, can supply samples x y aesthetic. visualize analytical distributions, can use xdist ydist aesthetic. historical reasons, can also use dist specify distribution, though recommended work well orientation detection. aesthetics can used follows: xdist, ydist, dist can distribution object distributional package (dist_normal(), dist_beta(), etc) can posterior::rvar() object. Since functions vectorized, columns can passed directly aes() specification; e.g. aes(dist = dist_normal(mu, sigma)) work mu sigma columns input data frame. dist can character vector giving distribution name.  arg1, ... arg9 aesthetics (args list column) specify distribution arguments. Distribution names correspond R functions \"p\", \"q\", \"d\" functions; e.g. \"norm\" valid distribution name R defines pnorm(), qnorm(), dnorm() functions Normal distributions. See parse_dist() function useful way generate dist args values human-readable distribution specs (like \"normal(0,1)\"). specs also produced packages (like brms::get_prior function brms); thus, parse_dist() combined stats described can help visualize output functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_pointinterval.html","id":"computed-variables","dir":"Reference","previous_headings":"","what":"Computed Variables","title":"Point + multiple-interval plot (shortcut stat) — stat_pointinterval","text":"following variables computed stat made available use aesthetic specifications (aes()) using after_stat() function after_stat argument stage(): x y: slabs, input values slab function. intervals, point summary interval function. Whether x y depends orientation xmin ymin: intervals, lower end interval interval function. xmax ymax: intervals, upper end interval interval function. .width: intervals, interval width numeric value [0, 1]. slabs, width smallest interval containing value slab. level: intervals, interval width ordered factor. slabs, level smallest interval containing value slab. pdf: slabs, probability density function (PDF). options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, PDF point summary; intervals also pdf_min pdf_max PDF lower upper ends interval. cdf: slabs, cumulative distribution function. options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, CDF point summary; intervals also cdf_min cdf_max CDF lower upper ends interval.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_pointinterval.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Point + multiple-interval plot (shortcut stat) — stat_pointinterval","text":"slab+interval stats geoms wide variety aesthetics control appearance three sub-geometries: slab, point, interval. stats support following aesthetics: x: x position geometry (orientation = \"vertical\"); sample data summarized (orientation = \"horizontal\" sample data). y: y position geometry (orientation = \"horizontal\"); sample data summarized (orientation = \"vertical\" sample data). weight: using samples (.e. x y aesthetics, xdist ydist), optional weights applied draw. xdist: using analytical distributions, distribution map x axis: distributional object (e.g. dist_normal()) posterior::rvar() object. ydist: using analytical distributions, distribution map y axis: distributional object (e.g. dist_normal()) posterior::rvar() object. dist: using analytical distributions, name distribution (e.g. \"norm\"), distributional object (e.g. dist_normal()), posterior::rvar() object. See Details. args: Distribution arguments (args arg1, ... arg9). See Details. addition, default configuration (paired geom_pointinterval()) following aesthetics supported underlying geom: Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Point-specific aesthetics shape: Shape type used draw point sub-geometry. Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Point-specific color line override aesthetics point_fill: Override fill: fill color point. point_colour: (point_color) Override colour/color: outline color point. point_alpha: Override alpha: opacity point. point_size: Override size: size point. Deprecated aesthetics interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"slabinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/stat_pointinterval.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Point + multiple-interval plot (shortcut stat) — stat_pointinterval","text":"","code":"library(dplyr) library(ggplot2) library(distributional)  theme_set(theme_ggdist())  # ON SAMPLE DATA set.seed(1234) df = data.frame(   group = c(\"a\", \"b\", \"c\"),   value = rnorm(1500, mean = c(5, 7, 9), sd = c(1, 1.5, 1)) ) df %>%   ggplot(aes(x = value, y = group)) +   stat_pointinterval()   # ON ANALYTICAL DISTRIBUTIONS dist_df = data.frame(   group = c(\"a\", \"b\", \"c\"),   mean =  c(  5,   7,   8),   sd =    c(  1, 1.5,   1) ) # Vectorized distribution types, like distributional::dist_normal() # and posterior::rvar(), can be used with the `xdist` / `ydist` aesthetics dist_df %>%   ggplot(aes(y = group, xdist = dist_normal(mean, sd))) +   stat_pointinterval()"},{"path":"http://mjskay.github.io/ggdist/reference/stat_ribbon.html","id":null,"dir":"Reference","previous_headings":"","what":"Multiple-ribbon plot (shortcut stat) — stat_ribbon","title":"Multiple-ribbon plot (shortcut stat) — stat_ribbon","text":"combination stat_slabinterval() geom_lineribbon() sensible defaults making multiple-ribbon plots. geom_lineribbon() intended use data frames already summarized using point_interval() function, stat_ribbon() intended use directly data frames draws analytical distributions, perform summarization using point_interval() function. Roughly equivalent :","code":"stat_lineribbon(   show_point = FALSE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_ribbon.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Multiple-ribbon plot (shortcut stat) — stat_ribbon","text":"","code":"stat_ribbon(   mapping = NULL,   data = NULL,   geom = \"lineribbon\",   position = \"identity\",   ...,   .width = c(0.5, 0.8, 0.95),   point_interval = \"median_qi\",   orientation = NA,   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_ribbon.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Multiple-ribbon plot (shortcut stat) — stat_ribbon","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). geom Use override default connection stat_ribbon() geom_lineribbon() position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. paired default geom, geom_lineribbon(), include: step line/ribbon drawn step function? One : FALSE (default): draw step function. \"mid\" (TRUE): draw steps midway adjacent x values. \"hv\": draw horizontal--vertical steps. \"vh\": draw vertical--horizontal steps. TRUE alias \"mid\" step function ribbons, \"mid\" probably want (two step approaches ribbons either first last x value visible). .width .width argument passed point_interval: vector probabilities use determine widths resulting intervals. multiple probabilities provided, multiple intervals per group generated, different probability interval (value corresponding .width level generated variables). point_interval function point_interval() family (e.g., median_qi, mean_qi, mode_hdi, etc), string giving name function family (e.g., \"median_qi\", \"mean_qi\", \"mode_hdi\", etc; string, caller's environment searched function, followed ggdist environment). function determines point summary (typically mean, median, mode) interval type (quantile interval, qi; highest-density interval, hdi; highest-density continuous interval, hdci). Output converted appropriate x- y-based aesthetics depending value orientation. See point_interval() family functions information. orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_ribbon.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Multiple-ribbon plot (shortcut stat) — stat_ribbon","text":"ggplot2::Stat representing multiple-ribbon geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_ribbon.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Multiple-ribbon plot (shortcut stat) — stat_ribbon","text":"visualize sample data, data distribution, samples bootstrap distribution, Bayesian posterior, can supply samples x y aesthetic. visualize analytical distributions, can use xdist ydist aesthetic. historical reasons, can also use dist specify distribution, though recommended work well orientation detection. aesthetics can used follows: xdist, ydist, dist can distribution object distributional package (dist_normal(), dist_beta(), etc) can posterior::rvar() object. Since functions vectorized, columns can passed directly aes() specification; e.g. aes(dist = dist_normal(mu, sigma)) work mu sigma columns input data frame. dist can character vector giving distribution name.  arg1, ... arg9 aesthetics (args list column) specify distribution arguments. Distribution names correspond R functions \"p\", \"q\", \"d\" functions; e.g. \"norm\" valid distribution name R defines pnorm(), qnorm(), dnorm() functions Normal distributions. See parse_dist() function useful way generate dist args values human-readable distribution specs (like \"normal(0,1)\"). specs also produced packages (like brms::get_prior function brms); thus, parse_dist() combined stats described can help visualize output functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_ribbon.html","id":"computed-variables","dir":"Reference","previous_headings":"","what":"Computed Variables","title":"Multiple-ribbon plot (shortcut stat) — stat_ribbon","text":"following variables computed stat made available use aesthetic specifications (aes()) using after_stat() function after_stat argument stage(): x y: slabs, input values slab function. intervals, point summary interval function. Whether x y depends orientation xmin ymin: intervals, lower end interval interval function. xmax ymax: intervals, upper end interval interval function. .width: intervals, interval width numeric value [0, 1]. slabs, width smallest interval containing value slab. level: intervals, interval width ordered factor. slabs, level smallest interval containing value slab. pdf: slabs, probability density function (PDF). options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, PDF point summary; intervals also pdf_min pdf_max PDF lower upper ends interval. cdf: slabs, cumulative distribution function. options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, CDF point summary; intervals also cdf_min cdf_max CDF lower upper ends interval.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_ribbon.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Multiple-ribbon plot (shortcut stat) — stat_ribbon","text":"line+ribbon stats geoms wide variety aesthetics control appearance two sub-geometries: line ribbon. stats support following aesthetics: x: x position geometry (orientation = \"vertical\"); sample data summarized (orientation = \"horizontal\" sample data). y: y position geometry (orientation = \"horizontal\"); sample data summarized (orientation = \"vertical\" sample data). weight: using samples (.e. x y aesthetics, xdist ydist), optional weights applied draw. xdist: using analytical distributions, distribution map x axis: distributional object (e.g. dist_normal()) posterior::rvar() object. ydist: using analytical distributions, distribution map y axis: distributional object (e.g. dist_normal()) posterior::rvar() object. dist: using analytical distributions, name distribution (e.g. \"norm\"), distributional object (e.g. dist_normal()), posterior::rvar() object. See Details. args: Distribution arguments (args arg1, ... arg9). See Details. addition, default configuration (paired geom_lineribbon()) following aesthetics supported underlying geom: Ribbon-specific aesthetics xmin: Left edge ribbon sub-geometry (orientation = \"horizontal\"). xmax: Right edge ribbon sub-geometry (orientation = \"horizontal\"). ymin: Lower edge ribbon sub-geometry (orientation = \"vertical\"). ymax: Upper edge ribbon sub-geometry (orientation = \"vertical\"). order: order ribbons drawn. Ribbons smallest mean value order drawn first (.e., drawn ribbons larger mean values order). order supplied geom_lineribbon(), -abs(xmax - xmin) -abs(ymax - ymax) (depending orientation) used, effect drawing widest (average) ribbons bottom. stat_lineribbon() uses order = after_stat(level) default, causing ribbons generated largest .width drawn bottom. Color aesthetics colour: (color) color line sub-geometry. fill: fill color ribbon sub-geometry. alpha: opacity line ribbon sub-geometries. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. aesthetics (work standard geoms) group See examples aesthetics action vignette(\"lineribbon\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/stat_ribbon.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Multiple-ribbon plot (shortcut stat) — stat_ribbon","text":"","code":"library(dplyr) library(ggplot2) library(distributional)  theme_set(theme_ggdist())  # ON SAMPLE DATA set.seed(12345) tibble(   x = rep(1:10, 100),   y = rnorm(1000, x) ) %>%   ggplot(aes(x = x, y = y)) +   stat_ribbon() +   scale_fill_brewer()   # ON ANALYTICAL DISTRIBUTIONS # Vectorized distribution types, like distributional::dist_normal() # and posterior::rvar(), can be used with the `xdist` / `ydist` aesthetics tibble(   x = 1:10,   sd = seq(1, 3, length.out = 10) ) %>%   ggplot(aes(x = x, ydist = dist_normal(x, sd))) +   stat_ribbon() +   scale_fill_brewer()"},{"path":"http://mjskay.github.io/ggdist/reference/stat_slab.html","id":null,"dir":"Reference","previous_headings":"","what":"Slab (ridge) plot (shortcut stat) — stat_slab","title":"Slab (ridge) plot (shortcut stat) — stat_slab","text":"Shortcut version stat_slabinterval() geom_slab() creating slab (ridge) plots. Roughly equivalent :","code":"stat_slabinterval(   aes(size = NULL),   geom = \"slab\",   show_point = FALSE,   show_interval = FALSE,   show.legend = NA )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_slab.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Slab (ridge) plot (shortcut stat) — stat_slab","text":"","code":"stat_slab(   mapping = NULL,   data = NULL,   geom = \"slab\",   position = \"identity\",   ...,   p_limits = c(NA, NA),   density = \"bounded\",   adjust = waiver(),   trim = TRUE,   expand = FALSE,   breaks = waiver(),   align = \"none\",   outline_bars = FALSE,   slab_type = NULL,   limits = NULL,   n = 501,   orientation = NA,   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_slab.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Slab (ridge) plot (shortcut stat) — stat_slab","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). geom Use override default connection stat_slab() geom_slab() position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. paired default geom, geom_slab(), include: normalize normalize heights functions input thickness aesthetic. One : \"\": normalize maximum height across data 1. \"panels\": normalize within panels maximum height panel 1. \"xy\": normalize within x/y axis opposite orientation geom maximum height value opposite axis 1. \"groups\": normalize within values opposite axis within group maximum height group 1. \"none\": values taken normalization (probably used functions whose values [0,1], CDFs). comprehensive discussion examples slab scaling normalization, see thickness scale article. fill_type type fill use fill color alpha varies within slab. One : \"segments\": breaks slab geometry segments unique combination fill color alpha value. approach supported graphics devices works well sharp cutoff values, can give ugly results large number unique fill colors used (gradients, like stat_gradientinterval()). \"gradient\": grid::linearGradient() used create smooth gradient fill. works well large numbers unique fill colors, requires R >= 4.1 yet supported graphics devices. writing, png() graphics device type = \"cairo\", svg() device, pdf() device, ragg::agg_png() devices known support option. R < 4.1, option fall back fill_type = \"segments\" message. \"auto\": attempts use fill_type = \"gradient\" support can auto-detected. R >= 4.2, support gradients can auto-detected graphics devices; support detected, option fall back fill_type = \"segments\" (case false negative, fill_type = \"gradient\" can set explicitly). R < 4.2, support gradients auto-detected, always fall back fill_type = \"segments\", case can set fill_type = \"gradient\" explicitly using graphics device support gradients. subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". p_limits Probability limits (vector size 2) used determine lower upper limits theoretical distributions (distributions samples ignore parameter determine limits based limits sample). E.g., c(.001, .999), slab drawn distribution quantile p = .001 quantile p = .999. lower (respectively upper) limit NA, lower (upper) limit minimum (maximum) distribution's support finite, 0.001 (0.999) finite. E.g., p_limits c(NA, NA), gamma distribution effective value p_limits c(0, .999) since gamma distribution defined (0, Inf); whereas normal distribution equivalent c(.001, .999) since normal distribution defined (-Inf, Inf). density Density estimator sample data. One : function takes numeric vector returns list elements x (giving grid points density estimator) y (corresponding densities). ggdist provides family functions following format, including density_unbounded() density_bounded(). format also compatible stats::density(). string giving suffix function name starts \"density_\"; e.g. \"bounded\" [density_bounded()], \"unbounded\" [density_unbounded()], \"histogram\" density_histogram(). Defaults \"bounded\", .e. density_bounded(), estimates bounds data uses bounded density estimator based reflection method. adjust Passed density: bandwidth density estimator sample data adjusted multiplying value. See e.g. density_bounded() information. Default (waiver()) defers default density estimator, usually 1. trim sample data, density estimate trimmed range data? Passed density estimator; see density parameter. Default TRUE. expand sample data, slab expanded limits scale? Default FALSE. Can length two control expansion lower upper limit respectively. breaks Determines breakpoints defining bins. Defaults \"Scott\". Similar (exactly ) breaks argument graphics::hist(). One : scalar (length-1) numeric giving number bins vector numeric giving breakpoints histogram bins function taking x weights returning either number bins vector breakpoints string giving suffix function starts \"breaks_\". ggdist provides weighted implementations \"Sturges\", \"Scott\", \"FD\" break-finding algorithms graphics::hist(), well breaks_fixed() manually setting bin width. See breaks. example, breaks = \"Sturges\" use breaks_Sturges() algorithm, breaks = 9 create 9 bins, breaks = breaks_fixed(width = 1) set bin width 1. align Determines align breakpoints defining bins. Default (\"none\") performs alignment. One : scalar (length-1) numeric giving offset subtracted breaks. offset must 0 bin width. function taking sorted vector breaks (bin edges) returning offset subtract breaks. string giving suffix function starts \"align_\" used determine alignment, align_none(), align_boundary(), align_center(). example, align = \"none\" provide alignment, align = align_center(= 0) center bin 0, align = align_boundary(= 0) align bin edge 0. outline_bars sample data (density \"histogram\") discrete analytical distributions (whose slabs drawn histograms), determines outlines bars drawn slab_color aesthetic used. FALSE (default), outline drawn along tops bars; TRUE, outlines bars also drawn. See density_histogram(). slab_type (deprecated) type slab function calculate: probability density (mass) function (\"pdf\"), cumulative distribution function (\"cdf\"), complementary CDF (\"ccdf\"). Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf,  1 - cdf) directly onto desired aesthetic. limits Manually-specified limits slab, vector length two. limits combined computed based p_limits well limits defined scales plot determine limits used draw slab functions: limits specify maximal limits; .e., specified, limits wider (may narrower). Use NA leave limit alone; e.g. limits = c(0, NA) ensure lower limit go 0, let upper limit determined either p_limits scale settings. n Number points evaluate function defines slab. orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend layer included legends? Default c(size = FALSE), unlike geoms, match common use cases. FALSE hides legends, TRUE shows legends, NA shows mapped (default geoms). inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_slab.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Slab (ridge) plot (shortcut stat) — stat_slab","text":"ggplot2::Stat representing slab (ridge) geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_slab.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Slab (ridge) plot (shortcut stat) — stat_slab","text":"visualize sample data, data distribution, samples bootstrap distribution, Bayesian posterior, can supply samples x y aesthetic. visualize analytical distributions, can use xdist ydist aesthetic. historical reasons, can also use dist specify distribution, though recommended work well orientation detection. aesthetics can used follows: xdist, ydist, dist can distribution object distributional package (dist_normal(), dist_beta(), etc) can posterior::rvar() object. Since functions vectorized, columns can passed directly aes() specification; e.g. aes(dist = dist_normal(mu, sigma)) work mu sigma columns input data frame. dist can character vector giving distribution name.  arg1, ... arg9 aesthetics (args list column) specify distribution arguments. Distribution names correspond R functions \"p\", \"q\", \"d\" functions; e.g. \"norm\" valid distribution name R defines pnorm(), qnorm(), dnorm() functions Normal distributions. See parse_dist() function useful way generate dist args values human-readable distribution specs (like \"normal(0,1)\"). specs also produced packages (like brms::get_prior function brms); thus, parse_dist() combined stats described can help visualize output functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_slab.html","id":"computed-variables","dir":"Reference","previous_headings":"","what":"Computed Variables","title":"Slab (ridge) plot (shortcut stat) — stat_slab","text":"following variables computed stat made available use aesthetic specifications (aes()) using after_stat() function after_stat argument stage(): x y: slabs, input values slab function. intervals, point summary interval function. Whether x y depends orientation xmin ymin: intervals, lower end interval interval function. xmax ymax: intervals, upper end interval interval function. .width: intervals, interval width numeric value [0, 1]. slabs, width smallest interval containing value slab. level: intervals, interval width ordered factor. slabs, level smallest interval containing value slab. pdf: slabs, probability density function (PDF). options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, PDF point summary; intervals also pdf_min pdf_max PDF lower upper ends interval. cdf: slabs, cumulative distribution function. options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, CDF point summary; intervals also cdf_min cdf_max CDF lower upper ends interval. n: slabs, number data points summarized slab. slab created analytical distribution via xdist, ydist, dist aesthetic, n Inf. f: (deprecated) slabs, output values slab function (PDF, CDF, CCDF), determined slab_type. Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf, 1 - cdf) directly onto desired aesthetic.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_slab.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Slab (ridge) plot (shortcut stat) — stat_slab","text":"slab+interval stats geoms wide variety aesthetics control appearance three sub-geometries: slab, point, interval. stats support following aesthetics: x: x position geometry (orientation = \"vertical\"); sample data summarized (orientation = \"horizontal\" sample data). y: y position geometry (orientation = \"horizontal\"); sample data summarized (orientation = \"vertical\" sample data). weight: using samples (.e. x y aesthetics, xdist ydist), optional weights applied draw. xdist: using analytical distributions, distribution map x axis: distributional object (e.g. dist_normal()) posterior::rvar() object. ydist: using analytical distributions, distribution map y axis: distributional object (e.g. dist_normal()) posterior::rvar() object. dist: using analytical distributions, name distribution (e.g. \"norm\"), distributional object (e.g. dist_normal()), posterior::rvar() object. See Details. args: Distribution arguments (args arg1, ... arg9). See Details. addition, default configuration (paired geom_slab()) following aesthetics supported underlying geom: Slab-specific aesthetics thickness: thickness slab x value (orientation = \"horizontal\") y value (orientation = \"vertical\") slab. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. justification: Justification interval relative slab, 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). justification NULL (default), set automatically based value side: side \"top\"/\"right\" justification set 0, side \"bottom\"/\"left\" justification set 1, side \"\" justification set 0.5. Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Slab-specific color line override aesthetics slab_fill: Override fill: fill color slab. slab_colour: (slab_color) Override colour/color: outline color slab. slab_alpha: Override alpha: opacity slab. slab_linewidth: Override linwidth: width outline slab. slab_linetype: Override linetype: line type outline slab. Deprecated aesthetics slab_size: Use slab_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"slabinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/stat_slab.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Slab (ridge) plot (shortcut stat) — stat_slab","text":"","code":"library(dplyr) library(ggplot2) library(distributional)  theme_set(theme_ggdist())  # ON SAMPLE DATA set.seed(1234) df = data.frame(   group = c(\"a\", \"b\", \"c\"),   value = rnorm(1500, mean = c(5, 7, 9), sd = c(1, 1.5, 1)) ) df %>%   ggplot(aes(x = value, y = group)) +   stat_slab()   # ON ANALYTICAL DISTRIBUTIONS dist_df = data.frame(   group = c(\"a\", \"b\", \"c\"),   mean =  c(  5,   7,   8),   sd =    c(  1, 1.5,   1) ) # Vectorized distribution types, like distributional::dist_normal() # and posterior::rvar(), can be used with the `xdist` / `ydist` aesthetics dist_df %>%   ggplot(aes(y = group, xdist = dist_normal(mean, sd))) +   stat_slab()   # RIDGE PLOTS # \"ridge\" plots can be created by expanding the slabs to the limits of the plot # (expand = TRUE), allowing the density estimator to be nonzero outside the # limits of the data (trim = FALSE), and increasing the height of the slabs. data.frame(   group = letters[1:3],   value = rnorm(3000, 3:1) ) %>%   ggplot(aes(y = group, x = value)) +   stat_slab(color = \"black\", expand = TRUE, trim = FALSE, height = 2)"},{"path":"http://mjskay.github.io/ggdist/reference/stat_slabinterval.html","id":null,"dir":"Reference","previous_headings":"","what":"Slab + interval plots for sample data and analytical distributions (ggplot stat) — stat_slabinterval","title":"Slab + interval plots for sample data and analytical distributions (ggplot stat) — stat_slabinterval","text":"\"Meta\" stat computing distribution functions (densities CDFs) + intervals use geom_slabinterval(). Useful creating eye plots, half-eye plots, CCDF bar plots, gradient plots, histograms, . Sample data can supplied x y aesthetics analytical distributions (variety formats) can supplied xdist ydist aesthetics. See Details.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_slabinterval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Slab + interval plots for sample data and analytical distributions (ggplot stat) — stat_slabinterval","text":"","code":"stat_slabinterval(   mapping = NULL,   data = NULL,   geom = \"slabinterval\",   position = \"identity\",   ...,   p_limits = c(NA, NA),   density = \"bounded\",   adjust = waiver(),   trim = TRUE,   expand = FALSE,   breaks = waiver(),   align = \"none\",   outline_bars = FALSE,   point_interval = \"median_qi\",   slab_type = NULL,   limits = NULL,   n = 501,   .width = c(0.66, 0.95),   orientation = NA,   na.rm = FALSE,   show.legend = c(size = FALSE),   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_slabinterval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Slab + interval plots for sample data and analytical distributions (ggplot stat) — stat_slabinterval","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). geom Use override default connection stat_slabinterval() geom_slabinterval() position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. paired default geom, geom_slabinterval(), include: normalize normalize heights functions input thickness aesthetic. One : \"\": normalize maximum height across data 1. \"panels\": normalize within panels maximum height panel 1. \"xy\": normalize within x/y axis opposite orientation geom maximum height value opposite axis 1. \"groups\": normalize within values opposite axis within group maximum height group 1. \"none\": values taken normalization (probably used functions whose values [0,1], CDFs). comprehensive discussion examples slab scaling normalization, see thickness scale article. fill_type type fill use fill color alpha varies within slab. One : \"segments\": breaks slab geometry segments unique combination fill color alpha value. approach supported graphics devices works well sharp cutoff values, can give ugly results large number unique fill colors used (gradients, like stat_gradientinterval()). \"gradient\": grid::linearGradient() used create smooth gradient fill. works well large numbers unique fill colors, requires R >= 4.1 yet supported graphics devices. writing, png() graphics device type = \"cairo\", svg() device, pdf() device, ragg::agg_png() devices known support option. R < 4.1, option fall back fill_type = \"segments\" message. \"auto\": attempts use fill_type = \"gradient\" support can auto-detected. R >= 4.2, support gradients can auto-detected graphics devices; support detected, option fall back fill_type = \"segments\" (case false negative, fill_type = \"gradient\" can set explicitly). R < 4.2, support gradients auto-detected, always fall back fill_type = \"segments\", case can set fill_type = \"gradient\" explicitly using graphics device support gradients. interval_size_domain length-2 numeric vector giving minimum maximum values size linewidth aesthetics translated actual sizes intervals drawn according interval_size_range (see documentation argument.) interval_size_range length-2 numeric vector. geom scales raw size aesthetic values drawing interval point sizes, tend thick using default settings scale_size_continuous(), give sizes range c(1, 6). interval_size_domain value indicates input domain raw size values (typically equal value range argument scale_size_continuous() function), interval_size_range indicates desired output range size values (min max actual sizes used draw intervals). time recommended change value argument, may result strange scaling legends; argument holdover earlier versions size aesthetics targeting point interval separately. want adjust size interval points separately, can also use linewidth point_size aesthetics; see sub-geometry-scales. fatten_point multiplicative factor used adjust size point relative size thickest interval line. wish specify point sizes directly, can also use point_size aesthetic scale_point_size_continuous() scale_point_size_discrete(); sizes specified aesthetic adjusted using fatten_point. arrow grid::arrow() giving arrow heads use interval, NULL arrows. subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". p_limits Probability limits (vector size 2) used determine lower upper limits theoretical distributions (distributions samples ignore parameter determine limits based limits sample). E.g., c(.001, .999), slab drawn distribution quantile p = .001 quantile p = .999. lower (respectively upper) limit NA, lower (upper) limit minimum (maximum) distribution's support finite, 0.001 (0.999) finite. E.g., p_limits c(NA, NA), gamma distribution effective value p_limits c(0, .999) since gamma distribution defined (0, Inf); whereas normal distribution equivalent c(.001, .999) since normal distribution defined (-Inf, Inf). density Density estimator sample data. One : function takes numeric vector returns list elements x (giving grid points density estimator) y (corresponding densities). ggdist provides family functions following format, including density_unbounded() density_bounded(). format also compatible stats::density(). string giving suffix function name starts \"density_\"; e.g. \"bounded\" [density_bounded()], \"unbounded\" [density_unbounded()], \"histogram\" density_histogram(). Defaults \"bounded\", .e. density_bounded(), estimates bounds data uses bounded density estimator based reflection method. adjust Passed density: bandwidth density estimator sample data adjusted multiplying value. See e.g. density_bounded() information. Default (waiver()) defers default density estimator, usually 1. trim sample data, density estimate trimmed range data? Passed density estimator; see density parameter. Default TRUE. expand sample data, slab expanded limits scale? Default FALSE. Can length two control expansion lower upper limit respectively. breaks Determines breakpoints defining bins. Defaults \"Scott\". Similar (exactly ) breaks argument graphics::hist(). One : scalar (length-1) numeric giving number bins vector numeric giving breakpoints histogram bins function taking x weights returning either number bins vector breakpoints string giving suffix function starts \"breaks_\". ggdist provides weighted implementations \"Sturges\", \"Scott\", \"FD\" break-finding algorithms graphics::hist(), well breaks_fixed() manually setting bin width. See breaks. example, breaks = \"Sturges\" use breaks_Sturges() algorithm, breaks = 9 create 9 bins, breaks = breaks_fixed(width = 1) set bin width 1. align Determines align breakpoints defining bins. Default (\"none\") performs alignment. One : scalar (length-1) numeric giving offset subtracted breaks. offset must 0 bin width. function taking sorted vector breaks (bin edges) returning offset subtract breaks. string giving suffix function starts \"align_\" used determine alignment, align_none(), align_boundary(), align_center(). example, align = \"none\" provide alignment, align = align_center(= 0) center bin 0, align = align_boundary(= 0) align bin edge 0. outline_bars sample data (density \"histogram\") discrete analytical distributions (whose slabs drawn histograms), determines outlines bars drawn slab_color aesthetic used. FALSE (default), outline drawn along tops bars; TRUE, outlines bars also drawn. See density_histogram(). point_interval function point_interval() family (e.g., median_qi, mean_qi, mode_hdi, etc), string giving name function family (e.g., \"median_qi\", \"mean_qi\", \"mode_hdi\", etc; string, caller's environment searched function, followed ggdist environment). function determines point summary (typically mean, median, mode) interval type (quantile interval, qi; highest-density interval, hdi; highest-density continuous interval, hdci). Output converted appropriate x- y-based aesthetics depending value orientation. See point_interval() family functions information. slab_type (deprecated) type slab function calculate: probability density (mass) function (\"pdf\"), cumulative distribution function (\"cdf\"), complementary CDF (\"ccdf\"). Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf,  1 - cdf) directly onto desired aesthetic. limits Manually-specified limits slab, vector length two. limits combined computed based p_limits well limits defined scales plot determine limits used draw slab functions: limits specify maximal limits; .e., specified, limits wider (may narrower). Use NA leave limit alone; e.g. limits = c(0, NA) ensure lower limit go 0, let upper limit determined either p_limits scale settings. n Number points evaluate function defines slab. .width .width argument passed point_interval: vector probabilities use determine widths resulting intervals. multiple probabilities provided, multiple intervals per group generated, different probability interval (value corresponding .width level generated variables). orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend layer included legends? Default c(size = FALSE), unlike geoms, match common use cases. FALSE hides legends, TRUE shows legends, NA shows mapped (default geoms). inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_slabinterval.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Slab + interval plots for sample data and analytical distributions (ggplot stat) — stat_slabinterval","text":"ggplot2::Stat representing slab combined slab+interval geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_slabinterval.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Slab + interval plots for sample data and analytical distributions (ggplot stat) — stat_slabinterval","text":"highly configurable stat generating variety plots combine \"slab\" describes distribution plus point summary number intervals. Several \"shortcut\" stats provided combine multiple options create useful geoms, particularly eye plots (violin plot density plus interval), half-eye plots (density plot plus interval), CCDF bar plots (complementary CDF plus interval), gradient plots (density encoded color alpha plus interval). shortcut stats include: stat_eye(): Eye plots (violin + interval) stat_halfeye(): Half-eye plots (density + interval) stat_ccdfinterval(): CCDF bar plots (CCDF + interval) stat_cdfinterval(): CDF bar plots (CDF + interval) stat_gradientinterval(): Density gradient + interval plots stat_slab(): Density plots stat_histinterval(): Histogram + interval plots stat_pointinterval(): Point + interval plots stat_interval(): Interval plots visualize sample data, data distribution, samples bootstrap distribution, Bayesian posterior, can supply samples x y aesthetic. visualize analytical distributions, can use xdist ydist aesthetic. historical reasons, can also use dist specify distribution, though recommended work well orientation detection. aesthetics can used follows: xdist, ydist, dist can distribution object distributional package (dist_normal(), dist_beta(), etc) can posterior::rvar() object. Since functions vectorized, columns can passed directly aes() specification; e.g. aes(dist = dist_normal(mu, sigma)) work mu sigma columns input data frame. dist can character vector giving distribution name.  arg1, ... arg9 aesthetics (args list column) specify distribution arguments. Distribution names correspond R functions \"p\", \"q\", \"d\" functions; e.g. \"norm\" valid distribution name R defines pnorm(), qnorm(), dnorm() functions Normal distributions. See parse_dist() function useful way generate dist args values human-readable distribution specs (like \"normal(0,1)\"). specs also produced packages (like brms::get_prior function brms); thus, parse_dist() combined stats described can help visualize output functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_slabinterval.html","id":"computed-variables","dir":"Reference","previous_headings":"","what":"Computed Variables","title":"Slab + interval plots for sample data and analytical distributions (ggplot stat) — stat_slabinterval","text":"following variables computed stat made available use aesthetic specifications (aes()) using after_stat() function after_stat argument stage(): x y: slabs, input values slab function. intervals, point summary interval function. Whether x y depends orientation xmin ymin: intervals, lower end interval interval function. xmax ymax: intervals, upper end interval interval function. .width: intervals, interval width numeric value [0, 1]. slabs, width smallest interval containing value slab. level: intervals, interval width ordered factor. slabs, level smallest interval containing value slab. pdf: slabs, probability density function (PDF). options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, PDF point summary; intervals also pdf_min pdf_max PDF lower upper ends interval. cdf: slabs, cumulative distribution function. options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, CDF point summary; intervals also cdf_min cdf_max CDF lower upper ends interval. n: slabs, number data points summarized slab. slab created analytical distribution via xdist, ydist, dist aesthetic, n Inf. f: (deprecated) slabs, output values slab function (PDF, CDF, CCDF), determined slab_type. Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf, 1 - cdf) directly onto desired aesthetic.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_slabinterval.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Slab + interval plots for sample data and analytical distributions (ggplot stat) — stat_slabinterval","text":"slab+interval stats geoms wide variety aesthetics control appearance three sub-geometries: slab, point, interval. stats support following aesthetics: x: x position geometry (orientation = \"vertical\"); sample data summarized (orientation = \"horizontal\" sample data). y: y position geometry (orientation = \"horizontal\"); sample data summarized (orientation = \"vertical\" sample data). weight: using samples (.e. x y aesthetics, xdist ydist), optional weights applied draw. xdist: using analytical distributions, distribution map x axis: distributional object (e.g. dist_normal()) posterior::rvar() object. ydist: using analytical distributions, distribution map y axis: distributional object (e.g. dist_normal()) posterior::rvar() object. dist: using analytical distributions, name distribution (e.g. \"norm\"), distributional object (e.g. dist_normal()), posterior::rvar() object. See Details. args: Distribution arguments (args arg1, ... arg9). See Details. addition, default configuration (paired geom_slabinterval()) following aesthetics supported underlying geom: Slab-specific aesthetics thickness: thickness slab x value (orientation = \"horizontal\") y value (orientation = \"vertical\") slab. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. justification: Justification interval relative slab, 0 indicates bottom/left justification 1 indicates top/right justification (depending orientation). justification NULL (default), set automatically based value side: side \"top\"/\"right\" justification set 0, side \"bottom\"/\"left\" justification set 1, side \"\" justification set 0.5. datatype: using composite geoms directly without stat (e.g. geom_slabinterval()), datatype used indicate part geom row data targets: rows datatype = \"slab\" target slab portion geometry rows datatype = \"interval\" target interval portion geometry. set automatically using ggdist stats. Interval-specific aesthetics xmin: Left end interval sub-geometry (orientation = \"horizontal\"). xmax: Right end interval sub-geometry (orientation = \"horizontal\"). ymin: Lower end interval sub-geometry (orientation = \"vertical\"). ymax: Upper end interval sub-geometry (orientation = \"vertical\"). Point-specific aesthetics shape: Shape type used draw point sub-geometry. Color aesthetics colour: (color) color interval point sub-geometries. Use slab_color, interval_color, point_color aesthetics () set sub-geometry colors separately. fill: fill color slab point sub-geometries. Use slab_fill point_fill aesthetics () set sub-geometry colors separately. alpha: opacity slab, interval, point sub-geometries. Use slab_alpha, interval_alpha, point_alpha aesthetics () set sub-geometry colors separately. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw interval (except geom_slab(): width slab). composite geometries including interval slab, use slab_linewidth set line width slab (see ). interval, raw linewidth values transformed according interval_size_domain interval_size_range parameters geom (see ). size: Determines size point. linewidth provided, size also determines width line used draw interval (allows line width point size modified together setting size linewidth). Raw size values transformed according interval_size_domain, interval_size_range, fatten_point parameters geom (see ). Use point_size aesthetic () set sub-geometry size directly without applying effects interval_size_domain, interval_size_range, fatten_point. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw interval outline slab (visible). Use slab_linetype interval_linetype aesthetics () set sub-geometry line types separately. Slab-specific color line override aesthetics slab_fill: Override fill: fill color slab. slab_colour: (slab_color) Override colour/color: outline color slab. slab_alpha: Override alpha: opacity slab. slab_linewidth: Override linwidth: width outline slab. slab_linetype: Override linetype: line type outline slab. Interval-specific color line override aesthetics interval_colour: (interval_color) Override colour/color: color interval. interval_alpha: Override alpha: opacity interval. interval_linetype: Override linetype: line type interval. Point-specific color line override aesthetics point_fill: Override fill: fill color point. point_colour: (point_color) Override colour/color: outline color point. point_alpha: Override alpha: opacity point. point_size: Override size: size point. Deprecated aesthetics slab_size: Use slab_linewidth. interval_size: Use interval_linewidth. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"slabinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/stat_slabinterval.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Slab + interval plots for sample data and analytical distributions (ggplot stat) — stat_slabinterval","text":"","code":"library(dplyr) library(ggplot2) library(distributional)  theme_set(theme_ggdist())   # EXAMPLES ON SAMPLE DATA set.seed(1234) df = data.frame(   group = c(\"a\", \"b\", \"c\", \"c\", \"c\"),   value = rnorm(2500, mean = c(5, 7, 9, 9, 9), sd = c(1, 1.5, 1, 1, 1)) )  # here are vertical eyes: df %>%   ggplot(aes(x = group, y = value)) +   stat_eye()   # note the sample size is not automatically incorporated into the # area of the densities in case one wishes to plot densities against # a reference (e.g. a prior distribution). # But you may wish to account for sample size if using these geoms # for something other than visualizing posteriors; in which case # you can use after_stat(f*n): df %>%   ggplot(aes(x = group, y = value)) +   stat_eye(aes(thickness = after_stat(pdf*n)))    # EXAMPLES ON ANALYTICAL DISTRIBUTIONS  dist_df = tribble(   ~group, ~subgroup, ~mean, ~sd,   \"a\",          \"h\",     5,   1,   \"b\",          \"h\",     7,   1.5,   \"c\",          \"h\",     8,   1,   \"c\",          \"i\",     9,   1,   \"c\",          \"j\",     7,   1 )  # Using functions from the distributional package (like dist_normal()) with the # dist aesthetic can lead to more compact/expressive specifications  dist_df %>%   ggplot(aes(x = group, ydist = dist_normal(mean, sd), fill = subgroup)) +   stat_eye(position = \"dodge\")   # using the old character vector + args approach dist_df %>%   ggplot(aes(x = group, dist = \"norm\", arg1 = mean, arg2 = sd, fill = subgroup)) +   stat_eye(position = \"dodge\")   # the stat_slabinterval family applies a Jacobian adjustment to densities # when plotting on transformed scales in order to plot them correctly. # It determines the Jacobian using symbolic differentiation if possible, # using stats::D(). If symbolic differentation fails, it falls back # to numericDeriv(), which is less reliable; therefore, it is # advisable to use scale transformation functions that are defined in # terms of basic math functions so that their derivatives can be # determined analytically (most of the transformation functions in the # scales package currently have this property). # For example, here is a log-Normal distribution plotted on the log # scale, where it will appear Normal: data.frame(dist = \"lnorm\", logmean = log(10), logsd = 2*log(10)) %>%   ggplot(aes(y = 1, dist = dist, arg1 = logmean, arg2 = logsd)) +   stat_halfeye() +   scale_x_log10(breaks = 10^seq(-5,7, by = 2))   # see vignette(\"slabinterval\") for many more examples."},{"path":"http://mjskay.github.io/ggdist/reference/stat_spike.html","id":null,"dir":"Reference","previous_headings":"","what":"Spike plot (ggplot2 stat) — stat_spike","title":"Spike plot (ggplot2 stat) — stat_spike","text":"Stat drawing \"spikes\" (optionally points ) specific points distribution (numerical determined function distribution), intended annotating stat_slabinterval() geometries.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_spike.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spike plot (ggplot2 stat) — stat_spike","text":"","code":"stat_spike(   mapping = NULL,   data = NULL,   geom = \"spike\",   position = \"identity\",   ...,   at = \"median\",   p_limits = c(NA, NA),   density = \"bounded\",   adjust = waiver(),   trim = TRUE,   expand = FALSE,   breaks = waiver(),   align = \"none\",   outline_bars = FALSE,   slab_type = NULL,   limits = NULL,   n = 501,   orientation = NA,   na.rm = FALSE,   show.legend = NA,   inherit.aes = TRUE )"},{"path":"http://mjskay.github.io/ggdist/reference/stat_spike.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Spike plot (ggplot2 stat) — stat_spike","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). geom Use override default connection stat_spike() geom_spike() position Position adjustment, either string, result call position adjustment function. Setting equal \"dodge\" (position_dodge()) \"dodgejust\" (position_dodgejust()) can useful overlapping geometries. ... arguments passed layer(). often aesthetics, used set aesthetic fixed value, like colour = \"red\" linewidth = 3 (see Aesthetics, ). may also parameters paired geom/stat. paired default geom, geom_spike(), include: normalize normalize heights functions input thickness aesthetic. One : \"\": normalize maximum height across data 1. \"panels\": normalize within panels maximum height panel 1. \"xy\": normalize within x/y axis opposite orientation geom maximum height value opposite axis 1. \"groups\": normalize within values opposite axis within group maximum height group 1. \"none\": values taken normalization (probably used functions whose values [0,1], CDFs). comprehensive discussion examples slab scaling normalization, see thickness scale article. arrow grid::arrow() giving arrow heads use spike, NULL arrows. subguide Sub-guide used annotate thickness scale. One : function takes scale argument giving ggplot2::Scale object orientation argument giving orientation geometry returns grid::grob draw axis annotation, subguide_axis() (draw traditional axis) subguide_none() (draw annotation). See subguide_axis() list possibilities examples. string giving name function prefixed \"subguide\"; e.g. \"axis\" \"none\". points evaluate PDF CDF distribution. One : numeric vector: points evaluate PDF CDF distributions . function character vector: function (names functions) , applied distribution-like object (e.g. distributional object posterior::rvar()), returns vector values evaluate distribution functions . list element (e.g. numeric, function, name function): evaluation points determined element list concatenated together. means, e.g., c(0, median, qi) add spike 0, median, endpoints qi distribution. values also converted character vector supplied computed variable (also called ) generated stat, can mapped onto aesthetics using after_stat(). Non-empty names can used override values computed variable; e.g. = c(zero = 0, \"median\", mode = \"Mode\") generate computed variable values c(\"zero\", \"median\", \"mode\") evaluated 0, median, mode distribution. p_limits Probability limits (vector size 2) used determine lower upper limits theoretical distributions (distributions samples ignore parameter determine limits based limits sample). E.g., c(.001, .999), slab drawn distribution quantile p = .001 quantile p = .999. lower (respectively upper) limit NA, lower (upper) limit minimum (maximum) distribution's support finite, 0.001 (0.999) finite. E.g., p_limits c(NA, NA), gamma distribution effective value p_limits c(0, .999) since gamma distribution defined (0, Inf); whereas normal distribution equivalent c(.001, .999) since normal distribution defined (-Inf, Inf). density Density estimator sample data. One : function takes numeric vector returns list elements x (giving grid points density estimator) y (corresponding densities). ggdist provides family functions following format, including density_unbounded() density_bounded(). format also compatible stats::density(). string giving suffix function name starts \"density_\"; e.g. \"bounded\" [density_bounded()], \"unbounded\" [density_unbounded()], \"histogram\" density_histogram(). Defaults \"bounded\", .e. density_bounded(), estimates bounds data uses bounded density estimator based reflection method. adjust Passed density: bandwidth density estimator sample data adjusted multiplying value. See e.g. density_bounded() information. Default (waiver()) defers default density estimator, usually 1. trim sample data, density estimate trimmed range data? Passed density estimator; see density parameter. Default TRUE. expand sample data, slab expanded limits scale? Default FALSE. Can length two control expansion lower upper limit respectively. breaks Determines breakpoints defining bins. Defaults \"Scott\". Similar (exactly ) breaks argument graphics::hist(). One : scalar (length-1) numeric giving number bins vector numeric giving breakpoints histogram bins function taking x weights returning either number bins vector breakpoints string giving suffix function starts \"breaks_\". ggdist provides weighted implementations \"Sturges\", \"Scott\", \"FD\" break-finding algorithms graphics::hist(), well breaks_fixed() manually setting bin width. See breaks. example, breaks = \"Sturges\" use breaks_Sturges() algorithm, breaks = 9 create 9 bins, breaks = breaks_fixed(width = 1) set bin width 1. align Determines align breakpoints defining bins. Default (\"none\") performs alignment. One : scalar (length-1) numeric giving offset subtracted breaks. offset must 0 bin width. function taking sorted vector breaks (bin edges) returning offset subtract breaks. string giving suffix function starts \"align_\" used determine alignment, align_none(), align_boundary(), align_center(). example, align = \"none\" provide alignment, align = align_center(= 0) center bin 0, align = align_boundary(= 0) align bin edge 0. outline_bars sample data (density \"histogram\") discrete analytical distributions (whose slabs drawn histograms), determines outlines bars drawn slab_color aesthetic used. FALSE (default), outline drawn along tops bars; TRUE, outlines bars also drawn. See density_histogram(). slab_type (deprecated) type slab function calculate: probability density (mass) function (\"pdf\"), cumulative distribution function (\"cdf\"), complementary CDF (\"ccdf\"). Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf,  1 - cdf) directly onto desired aesthetic. limits Manually-specified limits slab, vector length two. limits combined computed based p_limits well limits defined scales plot determine limits used draw slab functions: limits specify maximal limits; .e., specified, limits wider (may narrower). Use NA leave limit alone; e.g. limits = c(0, NA) ensure lower limit go 0, let upper limit determined either p_limits scale settings. n Number points evaluate function defines slab. orientation Whether geom drawn horizontally vertically. One : NA (default): automatically detect orientation based aesthetics assigned. Automatic detection works time. \"horizontal\" (\"y\"): draw horizontally, using y aesthetic identify different groups. group, uses x, xmin, xmax, thickness aesthetics draw points, intervals, slabs. \"vertical\" (\"x\"): draw vertically, using x aesthetic identify different groups. group, uses y, ymin, ymax, thickness aesthetics draw points, intervals, slabs. compatibility base ggplot naming scheme orientation, \"x\" can used alias \"vertical\" \"y\" alias \"horizontal\" (ggdist orientation parameter base ggplot , hence discrepancy). na.rm FALSE, default, missing values removed warning. TRUE, missing values silently removed. show.legend layer included legends? Default c(size = FALSE), unlike geoms, match common use cases. FALSE hides legends, TRUE shows legends, NA shows mapped (default geoms). inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_spike.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Spike plot (ggplot2 stat) — stat_spike","text":"ggplot2::Stat representing spike geometry can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_spike.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Spike plot (ggplot2 stat) — stat_spike","text":"stat computes slab values (.e. PDF CDF values) specified locations distribution, determined parameter. visualize sample data, data distribution, samples bootstrap distribution, Bayesian posterior, can supply samples x y aesthetic. visualize analytical distributions, can use xdist ydist aesthetic. historical reasons, can also use dist specify distribution, though recommended work well orientation detection. aesthetics can used follows: xdist, ydist, dist can distribution object distributional package (dist_normal(), dist_beta(), etc) can posterior::rvar() object. Since functions vectorized, columns can passed directly aes() specification; e.g. aes(dist = dist_normal(mu, sigma)) work mu sigma columns input data frame. dist can character vector giving distribution name.  arg1, ... arg9 aesthetics (args list column) specify distribution arguments. Distribution names correspond R functions \"p\", \"q\", \"d\" functions; e.g. \"norm\" valid distribution name R defines pnorm(), qnorm(), dnorm() functions Normal distributions. See parse_dist() function useful way generate dist args values human-readable distribution specs (like \"normal(0,1)\"). specs also produced packages (like brms::get_prior function brms); thus, parse_dist() combined stats described can help visualize output functions.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_spike.html","id":"aesthetics","dir":"Reference","previous_headings":"","what":"Aesthetics","title":"Spike plot (ggplot2 stat) — stat_spike","text":"spike geom wide variety aesthetics control appearance two sub-geometries: spike point. stats support following aesthetics: x: x position geometry (orientation = \"vertical\"); sample data summarized (orientation = \"horizontal\" sample data). y: y position geometry (orientation = \"horizontal\"); sample data summarized (orientation = \"vertical\" sample data). weight: using samples (.e. x y aesthetics, xdist ydist), optional weights applied draw. xdist: using analytical distributions, distribution map x axis: distributional object (e.g. dist_normal()) posterior::rvar() object. ydist: using analytical distributions, distribution map y axis: distributional object (e.g. dist_normal()) posterior::rvar() object. dist: using analytical distributions, name distribution (e.g. \"norm\"), distributional object (e.g. dist_normal()), posterior::rvar() object. See Details. args: Distribution arguments (args arg1, ... arg9). See Details. addition, default configuration (paired geom_spike()) following aesthetics supported underlying geom: Spike-specific (aka Slab-specific) aesthetics thickness: thickness slab x value (orientation = \"horizontal\") y value (orientation = \"vertical\") slab. side: side place slab . \"topright\", \"top\", \"right\" synonyms cause slab drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause slab drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes slab drawn top left, \"bottomright\" causes slab drawn bottom right. \"\" draws slab mirrored sides (violin plot). scale: proportion region allocated geom use draw slab. scale = 1, slabs use maximum range just touch . Default 0.9 leave space adjacent slabs. comprehensive discussion examples slab scaling normalization, see thickness scale article. Color aesthetics colour: (color) color spike point sub-geometries. fill: fill color point sub-geometry. alpha: opacity spike point sub-geometries. colour_ramp: (color_ramp) secondary scale modifies color scale \"ramp\" another color. See scale_colour_ramp() examples. fill_ramp: secondary scale modifies fill scale \"ramp\" another color. See scale_fill_ramp() examples. Line aesthetics linewidth: Width line used draw spike sub-geometry. size: Size point sub-geometry. stroke: Width outline around point sub-geometry. linetype: Type line (e.g., \"solid\", \"dashed\", etc) used draw spike. aesthetics (work standard geoms) width height group See examples aesthetics action vignette(\"slabinterval\"). Learn sub-geom override aesthetics (like interval_color) scales documentation. Learn basic ggplot aesthetics vignette(\"ggplot2-specs\").","code":""},{"path":"http://mjskay.github.io/ggdist/reference/stat_spike.html","id":"computed-variables","dir":"Reference","previous_headings":"","what":"Computed Variables","title":"Spike plot (ggplot2 stat) — stat_spike","text":"following variables computed stat made available use aesthetic specifications (aes()) using after_stat() function after_stat argument stage(): x y: slabs, input values slab function. intervals, point summary interval function. Whether x y depends orientation xmin ymin: intervals, lower end interval interval function. xmax ymax: intervals, upper end interval interval function. .width: intervals, interval width numeric value [0, 1]. slabs, width smallest interval containing value slab. level: intervals, interval width ordered factor. slabs, level smallest interval containing value slab. pdf: slabs, probability density function (PDF). options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, PDF point summary; intervals also pdf_min pdf_max PDF lower upper ends interval. cdf: slabs, cumulative distribution function. options(\"ggdist.experimental.slab_data_in_intervals\") TRUE: intervals, CDF point summary; intervals also cdf_min cdf_max CDF lower upper ends interval. n: slabs, number data points summarized slab. slab created analytical distribution via xdist, ydist, dist aesthetic, n Inf. f: (deprecated) slabs, output values slab function (PDF, CDF, CCDF), determined slab_type. Instead using slab_type change f mapping f onto aesthetic, now recommended simply map corresponding computed variable (e.g. pdf, cdf, 1 - cdf) directly onto desired aesthetic. : spikes, character vector names functions expressions used determine points slab functions evaluated create spikes. Values computed variable determined parameter; see description .","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/stat_spike.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Spike plot (ggplot2 stat) — stat_spike","text":"","code":"library(ggplot2) library(distributional) library(dplyr)  df = tibble(   d = c(dist_normal(1), dist_gamma(2,2)), g = c(\"a\", \"b\") )  # annotate the density at the mode of a distribution df %>%   ggplot(aes(y = g, xdist = d)) +   stat_slab(aes(xdist = d)) +   stat_spike(at = \"Mode\") +   # need shared thickness scale so that stat_slab and geom_spike line up   scale_thickness_shared()   # annotate the endpoints of intervals of a distribution # here we'll use an arrow instead of a point by setting size = 0 arrow_spec = arrow(angle = 45, type = \"closed\", length = unit(4, \"pt\")) df %>%   ggplot(aes(y = g, xdist = d)) +   stat_halfeye(point_interval = mode_hdci) +   stat_spike(     at = function(x) hdci(x, .width = .66),     size = 0, arrow = arrow_spec, color = \"blue\", linewidth = 0.75   ) +   scale_thickness_shared()   # annotate quantiles of a sample set.seed(1234) data.frame(x = rnorm(1000, 1:2), g = c(\"a\",\"b\")) %>%   ggplot(aes(x, g)) +   stat_slab() +   stat_spike(at = function(x) quantile(x, ppoints(10))) +   scale_thickness_shared()"},{"path":"http://mjskay.github.io/ggdist/reference/student_t.html","id":null,"dir":"Reference","previous_headings":"","what":"Scaled and shifted Student's t distribution — student_t","title":"Scaled and shifted Student's t distribution — student_t","text":"Density, distribution function, quantile function random generation scaled shifted Student's t distribution, parameterized degrees freedom (df), location (mu), scale (sigma).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/student_t.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scaled and shifted Student's t distribution — student_t","text":"","code":"dstudent_t(x, df, mu = 0, sigma = 1, log = FALSE)  pstudent_t(q, df, mu = 0, sigma = 1, lower.tail = TRUE, log.p = FALSE)  qstudent_t(p, df, mu = 0, sigma = 1, lower.tail = TRUE, log.p = FALSE)  rstudent_t(n, df, mu = 0, sigma = 1)"},{"path":"http://mjskay.github.io/ggdist/reference/student_t.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scaled and shifted Student's t distribution — student_t","text":"x, q vector quantiles. df degrees freedom (\\(> 0\\), maybe non-integer).  df       = Inf allowed. mu Location parameter (median) sigma Scale parameter log, log.p logical; TRUE, probabilities p given log(p). lower.tail logical; TRUE (default), probabilities     \\(P[X \\le x]\\), otherwise, \\(P[X > x]\\). p vector probabilities. n number observations. length(n) > 1, length     taken number required.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/student_t.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Scaled and shifted Student's t distribution — student_t","text":"dstudent_t gives density pstudent_t gives cumulative distribution function (CDF) qstudent_t gives quantile function (inverse CDF) rstudent_t generates random draws. length result determined n rstudent_t, maximum lengths numerical arguments functions. numerical arguments n recycled length result. first elements logical arguments used.","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/student_t.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Scaled and shifted Student's t distribution — student_t","text":"","code":"library(dplyr) library(ggplot2)  expand.grid(   df = c(3,5,10,30),   scale = c(1,1.5) ) %>%   ggplot(aes(y = 0, dist = \"student_t\", arg1 = df, arg2 = 0, arg3 = scale, color = ordered(df))) +   stat_slab(p_limits = c(.01, .99), fill = NA) +   scale_y_continuous(breaks = NULL) +   facet_grid( ~ scale) +   labs(     title = \"dstudent_t(x, df, 0, sigma)\",     subtitle = \"Scale (sigma)\",     y = NULL,     x = NULL   ) +   theme_ggdist() +   theme(axis.title = element_text(hjust = 0))"},{"path":"http://mjskay.github.io/ggdist/reference/sub-geometry-scales.html","id":null,"dir":"Reference","previous_headings":"","what":"Sub-geometry scales for geom_slabinterval (ggplot2 scales) — sub-geometry-scales","title":"Sub-geometry scales for geom_slabinterval (ggplot2 scales) — sub-geometry-scales","text":"scales allow specific aesthetic mappings made using geom_slabinterval() stats/geoms based (like eye plots).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/sub-geometry-scales.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sub-geometry scales for geom_slabinterval (ggplot2 scales) — sub-geometry-scales","text":"","code":"scale_point_colour_discrete(..., aesthetics = \"point_colour\")  scale_point_color_discrete(..., aesthetics = \"point_colour\")  scale_point_colour_continuous(   ...,   aesthetics = \"point_colour\",   guide = guide_colourbar2() )  scale_point_color_continuous(   ...,   aesthetics = \"point_colour\",   guide = guide_colourbar2() )  scale_point_fill_discrete(..., aesthetics = \"point_fill\")  scale_point_fill_continuous(   ...,   aesthetics = \"point_fill\",   guide = guide_colourbar2() )  scale_point_alpha_continuous(..., range = c(0.1, 1))  scale_point_alpha_discrete(..., range = c(0.1, 1))  scale_point_size_continuous(..., range = c(1, 6))  scale_point_size_discrete(..., range = c(1, 6), na.translate = FALSE)  scale_interval_colour_discrete(..., aesthetics = \"interval_colour\")  scale_interval_color_discrete(..., aesthetics = \"interval_colour\")  scale_interval_colour_continuous(   ...,   aesthetics = \"interval_colour\",   guide = guide_colourbar2() )  scale_interval_color_continuous(   ...,   aesthetics = \"interval_colour\",   guide = guide_colourbar2() )  scale_interval_alpha_continuous(..., range = c(0.1, 1))  scale_interval_alpha_discrete(..., range = c(0.1, 1))  scale_interval_size_continuous(..., range = c(1, 6))  scale_interval_size_discrete(..., range = c(1, 6), na.translate = FALSE)  scale_interval_linetype_discrete(..., na.value = \"blank\")  scale_interval_linetype_continuous(...)  scale_slab_colour_discrete(..., aesthetics = \"slab_colour\")  scale_slab_color_discrete(..., aesthetics = \"slab_colour\")  scale_slab_colour_continuous(   ...,   aesthetics = \"slab_colour\",   guide = guide_colourbar2() )  scale_slab_color_continuous(   ...,   aesthetics = \"slab_colour\",   guide = guide_colourbar2() )  scale_slab_fill_discrete(..., aesthetics = \"slab_fill\")  scale_slab_fill_continuous(   ...,   aesthetics = \"slab_fill\",   guide = guide_colourbar2() )  scale_slab_alpha_continuous(   ...,   limits = function(l) c(min(0, l[[1]]), l[[2]]),   range = c(0, 1) )  scale_slab_alpha_discrete(..., range = c(0.1, 1))  scale_slab_size_continuous(..., range = c(1, 6))  scale_slab_size_discrete(..., range = c(1, 6), na.translate = FALSE)  scale_slab_linewidth_continuous(..., range = c(1, 6))  scale_slab_linewidth_discrete(..., range = c(1, 6), na.translate = FALSE)  scale_slab_linetype_discrete(..., na.value = \"blank\")  scale_slab_linetype_continuous(...)  scale_slab_shape_discrete(..., solid = TRUE)  scale_slab_shape_continuous(...)  guide_colourbar2(...)  guide_colorbar2(...)"},{"path":"http://mjskay.github.io/ggdist/reference/sub-geometry-scales.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sub-geometry scales for geom_slabinterval (ggplot2 scales) — sub-geometry-scales","text":"... Arguments passed underlying scale guide functions. E.g. scale_point_color_discrete passes arguments scale_color_discrete(). See functions details. aesthetics Names aesthetics set scales . guide Guide use legends aesthetic. range numeric vector length 2 specifies minimum maximum size plotting symbol transformation. na.translate discrete scales, show missing values? na.value na.translate true, value shown? limits One : NULL use default scale range numeric vector length two providing limits scale. Use NA refer existing minimum maximum function accepts existing (automatic) limits returns new limits. Also accepts rlang lambda function notation. Note setting limits positional scales remove data outside limits. purpose zoom, use limit argument coordinate system (see coord_cartesian()). solid shapes solid, TRUE, hollow, FALSE?","code":""},{"path":"http://mjskay.github.io/ggdist/reference/sub-geometry-scales.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Sub-geometry scales for geom_slabinterval (ggplot2 scales) — sub-geometry-scales","text":"ggplot2::Scale representing one aesthetics used target appearance specific parts composite ggdist geoms. Can added ggplot() object.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/sub-geometry-scales.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Sub-geometry scales for geom_slabinterval (ggplot2 scales) — sub-geometry-scales","text":"following additional scales / aesthetics defined use geom_slabinterval() related geoms: scale_point_color_* Point color scale_point_fill_* Point fill color scale_point_alpha_* Point alpha level / opacity scale_point_size_* Point size scale_interval_color_* Interval line color scale_interval_alpha_* Interval alpha level / opacity scale_interval_linetype_* Interval line type scale_slab_color_* Slab outline color scale_slab_fill_* Slab fill color scale_slab_alpha_* Slab alpha level / opacity. default settings scale_slab_alpha_continuous differ scale_alpha_continuous() designed gradient plots (e.g. stat_gradientinterval()) ensuring densities 0 get mapped 0 output. scale_slab_linewidth_* Slab outline line width scale_slab_linetype_* Slab outline line type scale_slab_shape_* Slab dot shape (geom_dotsinterval()) See corresponding scale documentation ggplot information; e.g. scale_color_discrete(), scale_color_continuous(), etc. scale functions can used aesthetics/scales defined using aesthetics argument scale function. example, use color brewer scales point_color aesthetic: scale_color_brewer(..., aesthetics = \"point_color\") continuous color scales, may also need provide guide default guide work properly; guide_colorbar2 : scale_color_distiller(..., guide = \"colorbar2\", aesthetics = \"point_color\") scales deprecated: scale_interval_size_* Use scale_linewidth_* scale_slab_size_* Slab scale_size_linewidth_*","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/sub-geometry-scales.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Sub-geometry scales for geom_slabinterval (ggplot2 scales) — sub-geometry-scales","text":"Matthew Kay","code":""},{"path":"http://mjskay.github.io/ggdist/reference/sub-geometry-scales.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sub-geometry scales for geom_slabinterval (ggplot2 scales) — sub-geometry-scales","text":"","code":"library(dplyr) library(ggplot2)  # This plot shows how to set multiple specific aesthetics # NB it is very ugly and is only for demo purposes. data.frame(distribution = \"Normal(1,2)\") %>%   parse_dist(distribution) %>%   ggplot(aes(y = distribution, xdist = .dist, args = .args)) +   stat_halfeye(     shape = 21,  # this point shape has a fill and outline     point_color = \"red\",     point_fill = \"black\",     point_alpha = .1,     point_size = 6,     stroke = 2,     interval_color = \"blue\",     # interval line widths are scaled from [1, 6] onto [0.6, 1.4] by default     # see the interval_size_range parameter in help(\"geom_slabinterval\")     linewidth = 8,     interval_linetype = \"dashed\",     interval_alpha = .25,     # fill sets the fill color of the slab (here the density)     slab_color = \"green\",     slab_fill = \"purple\",     slab_linewidth = 3,     slab_linetype = \"dotted\",     slab_alpha = .5   )"},{"path":"http://mjskay.github.io/ggdist/reference/subguide_axis.html","id":null,"dir":"Reference","previous_headings":"","what":"Axis sub-guide for thickness scales — subguide_axis","title":"Axis sub-guide for thickness scales — subguide_axis","text":"sub-guide intended annotating thickness aesthetic ggdist. can used subguide parameter geom_slabinterval(). Supports automatic partial function application.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/subguide_axis.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Axis sub-guide for thickness scales — subguide_axis","text":"","code":"subguide_axis(   values,   title = NULL,   breaks = waiver(),   labels = waiver(),   position = 0,   just = 0,   label_side = \"topright\",   orientation = \"horizontal\",   theme = theme_get() )  subguide_inside(..., label_side = \"inside\")  subguide_outside(..., label_side = \"outside\", just = 1)  subguide_integer(..., breaks = scales::breaks_extended(Q = c(1, 5, 2, 4, 3)))  subguide_count(..., breaks = scales::breaks_width(1))"},{"path":"http://mjskay.github.io/ggdist/reference/subguide_axis.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Axis sub-guide for thickness scales — subguide_axis","text":"values Values used construct scale used guide. Typically provided automatically geom_slabinterval(). title title scale shown sub-guide's axis. breaks One : NULL breaks waiver() default breaks computed transformation object numeric vector positions function takes limits input returns breaks output (e.g., function returned scales::extended_breaks()). Also accepts rlang lambda function notation. labels One : NULL labels waiver() default labels computed transformation object character vector giving labels (must length breaks) expression vector (must length breaks). See ?plotmath details. function takes breaks input returns labels output. Also accepts rlang lambda function notation. position Numeric value 0 1 giving position guide relative axis: 0 causes sub-guide drawn left bottom depending orientation \"horizontal\" \"vertical\", 1 causes sub-guide drawn top right depending orientation \"horizontal\" \"vertical\". May also string indicating position: \"top\", \"right\", \"bottom\", \"left\", \"topright\", \"topleft\", \"bottomright\", \"bottomleft\". just Numeric value 0 1 giving justification guide relative position: 0 means aligned towards inside axis edge, 1 means aligned towards outside axis edge. label_side side axis draw ticks labels . \"topright\", \"top\", \"right\" synonyms cause labels drawn top right depending orientation \"horizontal\" \"vertical\". \"bottomleft\", \"bottom\", \"left\" synonyms cause labels drawn bottom left depending orientation \"horizontal\" \"vertical\". \"topleft\" causes labels drawn top left, \"bottomright\" causes labels drawn bottom right. \"inside\" causes labels drawn side closest inside chart, depending position, \"outside\" side closest outside chart. orientation Orientation geometry sub-guide . One \"horizontal\" (\"y\") \"vertical\" (\"x\"). See orientation parameter geom_slabinterval(). theme ggplot2::theme object used determine style sub-guide elements drawn . title label drawn using \"axis.title.x\" \"axis.title.y\" theme setting, axis line, ticks, tick labels drawn using guide_axis(), theme settings normally apply axis guides followed. ... Arguments passed functions, typically back subguide_axis() .","code":""},{"path":"http://mjskay.github.io/ggdist/reference/subguide_axis.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Axis sub-guide for thickness scales — subguide_axis","text":"subguide_inside() shortcut drawing labels inside chart region. subguide_outside() shortcut drawing labels outside chart region. subguide_integer() draws breaks integer values, useful labeling counts geom_dots(). subguide_count() shortcut drawing labels every whole number labeled, useful labeling counts geom_dots(). max count large, subguide_integer() may better.","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/subguide_axis.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Axis sub-guide for thickness scales — subguide_axis","text":"","code":"# example code library(ggplot2) library(distributional)  df = data.frame(d = dist_normal(2:3, 2:3), g = c(\"a\", \"b\"))  # subguides allow you to label thickness axes ggplot(df, aes(xdist = d, y = g)) +   stat_slabinterval(subguide = \"inside\")   # they respect normalization and use of scale_thickness_shared() ggplot(df, aes(xdist = d, y = g)) +   stat_slabinterval(subguide = \"inside\", normalize = \"groups\")   # they can also be positioned outside the plot area, though # this typically requires manually adjusting plot margins ggplot(df, aes(xdist = d, y = g)) +   stat_slabinterval(subguide = subguide_outside(title = \"density\", position = \"right\")) +   theme(plot.margin = margin(5.5, 50, 5.5, 5.5))   # any of the subguide types will also work to indicate bin counts in # geom_dots(); subguide_integer() and subguide_count() can be useful for # dotplots as they only label integers / whole numbers: df = data.frame(d = dist_gamma(2:3, 2:3), g = c(\"a\", \"b\")) ggplot(df, aes(xdist = d, y = g)) +   stat_dots(subguide = subguide_count(label_side = \"left\", title = \"count\")) +   scale_y_discrete(expand = expansion(add = 0.1)) +   scale_x_continuous(expand = expansion(add = 0.5))"},{"path":"http://mjskay.github.io/ggdist/reference/subguide_none.html","id":null,"dir":"Reference","previous_headings":"","what":"Empty sub-guide for thickness scales — subguide_none","title":"Empty sub-guide for thickness scales — subguide_none","text":"blank sub-guide omits annotations thickness aesthetic ggdist. can used subguide parameter geom_slabinterval().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/subguide_none.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Empty sub-guide for thickness scales — subguide_none","text":"","code":"subguide_none(...)"},{"path":"http://mjskay.github.io/ggdist/reference/subguide_none.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Empty sub-guide for thickness scales — subguide_none","text":"... ignored.","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/theme_ggdist.html","id":null,"dir":"Reference","previous_headings":"","what":"Simple, light ggplot2 theme for ggdist and tidybayes — theme_ggdist","title":"Simple, light ggplot2 theme for ggdist and tidybayes — theme_ggdist","text":"simple, relatively minimalist ggplot2 theme, helper functions go .","code":""},{"path":"http://mjskay.github.io/ggdist/reference/theme_ggdist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simple, light ggplot2 theme for ggdist and tidybayes — theme_ggdist","text":"","code":"theme_ggdist(   base_size = 11,   base_family = \"\",   base_line_size = base_size/22,   base_rect_size = base_size/22 )  theme_tidybayes(   base_size = 11,   base_family = \"\",   base_line_size = base_size/22,   base_rect_size = base_size/22 )  facet_title_horizontal()  axis_titles_bottom_left()  facet_title_left_horizontal()  facet_title_right_horizontal()"},{"path":"http://mjskay.github.io/ggdist/reference/theme_ggdist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simple, light ggplot2 theme for ggdist and tidybayes — theme_ggdist","text":"base_size base font size, given pts. base_family base font family base_line_size base size line elements base_rect_size base size rect elements","code":""},{"path":"http://mjskay.github.io/ggdist/reference/theme_ggdist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simple, light ggplot2 theme for ggdist and tidybayes — theme_ggdist","text":"named list format ggplot2::theme()","code":""},{"path":"http://mjskay.github.io/ggdist/reference/theme_ggdist.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Simple, light ggplot2 theme for ggdist and tidybayes — theme_ggdist","text":"relatively minimalist ggplot2 theme, intended used making publication-ready plots. currently based ggplot2::theme_light(). word warning: theme may (likely ) change future tweak taste. theme_ggdist() theme_tidybayes() aliases.","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/theme_ggdist.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Simple, light ggplot2 theme for ggdist and tidybayes — theme_ggdist","text":"Matthew Kay","code":""},{"path":"http://mjskay.github.io/ggdist/reference/theme_ggdist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Simple, light ggplot2 theme for ggdist and tidybayes — theme_ggdist","text":"","code":"library(ggplot2)  theme_set(theme_ggdist())"},{"path":"http://mjskay.github.io/ggdist/reference/tidy-format-translators.html","id":null,"dir":"Reference","previous_headings":"","what":"Translate between different tidy data frame formats for draws from distributions — tidy-format-translators","title":"Translate between different tidy data frame formats for draws from distributions — tidy-format-translators","text":"functions translate ggdist/tidybayes-style data frames /different data frame formats (format using different naming scheme columns).","code":""},{"path":"http://mjskay.github.io/ggdist/reference/tidy-format-translators.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Translate between different tidy data frame formats for draws from distributions — tidy-format-translators","text":"","code":"to_broom_names(data)  from_broom_names(data)  to_ggmcmc_names(data)  from_ggmcmc_names(data)"},{"path":"http://mjskay.github.io/ggdist/reference/tidy-format-translators.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Translate between different tidy data frame formats for draws from distributions — tidy-format-translators","text":"data data frame translate.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/tidy-format-translators.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Translate between different tidy data frame formats for draws from distributions — tidy-format-translators","text":"data frame (possibly) new names columns, according translation scheme described Details.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/tidy-format-translators.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Translate between different tidy data frame formats for draws from distributions — tidy-format-translators","text":"Function prefixed to_ translate ggdist/tidybayes format another format, functions prefixed from_ translate format back ggdist/tidybayes format. Formats include: to_broom_names() / from_broom_names(): .variable <-> term .value <-> estimate .prediction <-> .fitted .lower <-> conf.low .upper <-> conf.high to_ggmcmc_names() / from_ggmcmc_names(): .chain <-> Chain .iteration <-> Iteration .variable <-> Parameter .value <-> value","code":""},{"path":"http://mjskay.github.io/ggdist/reference/tidy-format-translators.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Translate between different tidy data frame formats for draws from distributions — tidy-format-translators","text":"Matthew Kay","code":""},{"path":"http://mjskay.github.io/ggdist/reference/tidy-format-translators.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Translate between different tidy data frame formats for draws from distributions — tidy-format-translators","text":"","code":"library(dplyr)  data(RankCorr_u_tau, package = \"ggdist\")  df = RankCorr_u_tau %>%   dplyr::rename(.variable = i, .value = u_tau) %>%   group_by(.variable) %>%   median_qi(.value)  df #> # A tibble: 3 × 7 #>   .variable .value .lower .upper .width .point .interval #>       <int>  <dbl>  <dbl>  <dbl>  <dbl> <chr>  <chr>     #> 1         1   5.62   3.86   8.03   0.95 median qi        #> 2         2   5.48   3.46   9.07   0.95 median qi        #> 3         3   4.96   3.10   7.86   0.95 median qi         df %>%   to_broom_names() #> # A tibble: 3 × 7 #>    term estimate conf.low conf.high .width .point .interval #>   <int>    <dbl>    <dbl>     <dbl>  <dbl> <chr>  <chr>     #> 1     1     5.62     3.86      8.03   0.95 median qi        #> 2     2     5.48     3.46      9.07   0.95 median qi        #> 3     3     4.96     3.10      7.86   0.95 median qi"},{"path":"http://mjskay.github.io/ggdist/reference/weighted_ecdf.html","id":null,"dir":"Reference","previous_headings":"","what":"Weighted empirical cumulative distribution function — weighted_ecdf","title":"Weighted empirical cumulative distribution function — weighted_ecdf","text":"variation ecdf() can applied weighted samples.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/weighted_ecdf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Weighted empirical cumulative distribution function — weighted_ecdf","text":"","code":"weighted_ecdf(x, weights = NULL, na.rm = FALSE)"},{"path":"http://mjskay.github.io/ggdist/reference/weighted_ecdf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Weighted empirical cumulative distribution function — weighted_ecdf","text":"x numeric vector: sample values weights Weights sample. One : numeric vector length x: weights corresponding values x, normalized sum 1. NULL: indicates weights provided, unweighted empirical cumulative distribution function (equivalent ecdf()) returned. na.rm logical: TRUE, corresponding entries x weights removed either NA.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/weighted_ecdf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Weighted empirical cumulative distribution function — weighted_ecdf","text":"weighted_ecdf() returns function class \"weighted_ecdf\", also inherits stepfun() class. Thus, also plot() print() methods. Like ecdf(), weighted_ecdf() also provides quantile() method, dispatches weighted_quantile().","code":""},{"path":"http://mjskay.github.io/ggdist/reference/weighted_ecdf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Weighted empirical cumulative distribution function — weighted_ecdf","text":"Generates weighted empirical cumulative distribution function, \\(F(x)\\). Given \\(x\\), sorted vector (derived x), \\(w_i\\), corresponding weight \\(x_i\\), \\(F(x)\\) step function steps \\(x_i\\) \\(F(x_i)\\) equal sum weights including \\(w_i\\).","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/reference/weighted_ecdf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Weighted empirical cumulative distribution function — weighted_ecdf","text":"","code":"weighted_ecdf(1:3, weights = 1:3) #> Step function #> Call: weighted_ecdf(1:3, weights = 1:3) #>  x[1:3] =      1,      2,      3 #> 4 plateau levels =      0, 0.16667,    0.5,      1 plot(weighted_ecdf(1:3, weights = 1:3))  quantile(weighted_ecdf(1:3, weights = 1:3), 0.4) #> 40%  #> 2.2"},{"path":"http://mjskay.github.io/ggdist/reference/weighted_quantile.html","id":null,"dir":"Reference","previous_headings":"","what":"Weighted sample quantiles — weighted_quantile","title":"Weighted sample quantiles — weighted_quantile","text":"variation quantile() can applied weighted samples.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/weighted_quantile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Weighted sample quantiles — weighted_quantile","text":"","code":"weighted_quantile(   x,   probs = seq(0, 1, 0.25),   weights = NULL,   n = NULL,   na.rm = FALSE,   names = TRUE,   type = 7,   digits = 7 )  weighted_quantile_fun(x, weights = NULL, n = NULL, na.rm = FALSE, type = 7)"},{"path":"http://mjskay.github.io/ggdist/reference/weighted_quantile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Weighted sample quantiles — weighted_quantile","text":"x numeric vector: sample values probs numeric vector: probabilities \\([0, 1]\\) weights Weights sample. One : numeric vector length x: weights corresponding values x, normalized sum 1. NULL: indicates weights provided, unweighted sample quantiles (equivalent quantile()) returned. n Presumed effective sample size. greater 1 continuous quantiles (type >= 4) requested, flat regions may added approximation inverse CDF areas normalized weight exceeds 1/n (.e., regions high density). can used ensure sample size n duplicate x values summarized weighted sample without duplicates, result weighted_quantile(..., n = n) weighted sample equal result quantile() original sample. One : NULL: make sample size adjustment. numeric: presumed effective sample size. function name function (string): function applied weights (prior normalization) determine sample size. useful values may : \"length\": .e. use number elements weights (equivalently x) effective sample size. \"sum\": .e. use sum unnormalized weights sample size. Useful provided weights unnormalized sum represents true sample size. na.rm logical: TRUE, corresponding entries x weights removed either NA. names logical: TRUE, add names output giving input probs formatted percentage. type integer 1 9: determines type quantile estimator used. Types 1 3 discontinuous quantiles, types 4 9 continuous quantiles. See Details. digits numeric: number digits use format percentages names TRUE.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/weighted_quantile.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Weighted sample quantiles — weighted_quantile","text":"weighted_quantile() returns numeric vector length(probs) estimate corresponding quantile probs. weighted_quantile_fun() returns function takes single argument, vector probabilities, returns corresponding quantile estimates. may useful weighted_quantile() needs called repeatedly sample, re-using pre-computation.","code":""},{"path":"http://mjskay.github.io/ggdist/reference/weighted_quantile.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Weighted sample quantiles — weighted_quantile","text":"Calculates weighted quantiles using variation quantile types based generalization quantile(). Type 1--3 (discontinuous) quantiles directly function inverse CDF step function, can directly translated weighted case using natural definition weighted ECDF cumulative sum normalized weights. Type 4--9 (continuous) quantiles require translation definitions quantile(). quantile() defines continuous estimators terms \\(x_k\\), \\(k\\)th order statistic, \\(p_k\\), function \\(k\\) \\(n\\) (sample size). weighted case, instead take \\(x_k\\) \\(k\\)th smallest value \\(x\\) weighted sample (necessarily order statistic, weights). can re-write formulas \\(p_k\\) terms \\(F(x_k)\\) (empirical CDF \\(x_k\\), .e. cumulative sum normalized weights) \\(f(x_k)\\) (normalized weight \\(x_k\\)), using fact , unweighted case, \\(k = F(x_k) \\cdot n\\) \\(1/n = f(x_k)\\): Type 4 \\(p_k = \\frac{k}{n} = F(x_k)\\) Type 5 \\(p_k = \\frac{k - 0.5}{n} = F(x_k) - \\frac{f(x_k)}{2}\\) Type 6 \\(p_k = \\frac{k}{n + 1} = \\frac{F(x_k)}{1 + f(x_k)}\\) Type 7 \\(p_k = \\frac{k - 1}{n - 1} = \\frac{F(x_k) - f(x_k)}{1 - f(x_k)}\\) Type 8 \\(p_k = \\frac{k - 1/3}{n + 1/3} = \\frac{F(x_k) - f(x_k)/3}{1 + f(x_k)/3}\\) Type 9 \\(p_k = \\frac{k - 3/8}{n + 1/4} = \\frac{F(x_k) - f(x_k) \\cdot 3/8}{1 + f(x_k)/4}\\) quantile function (inverse CDF) piece-wise linear function defined points \\((p_k, x_k)\\).","code":""},{"path":[]},{"path":"http://mjskay.github.io/ggdist/news/index.html","id":"ggdist-332","dir":"Changelog","previous_headings":"","what":"ggdist 3.3.2","title":"ggdist 3.3.2","text":"Major changes: geom_slabinterval() geom_dotsinterval() families gain “sub-guides”, can passed subguide parameter create axis annotations thickness aesthetic (slabs) dot count (dots) (#183). weight aesthetic now supported stat_slabinterval(), including weighted calculations densities, CDFs, interval types (quantile intervals, highest density intervals, highest density continuous intervals), point summaries (mean, median, mode) (#41). includes support upcoming weighted random variable type posterior package. Blurry dotplots now supported using geom_blur_dots(), accepts sd aesthetic set standard deviation blur dot. Intervals can also used place blur passing blur = \"interval\". geom used new stat_mcse_dots() show quantiles along error using blur (#63). new breaks_quantiles() histogram breaks function allows construction quantile histograms density_histogram(), stat_histinterval(), etc. color ramp scales (e.g. scale_colour_ramp_continuous(), …) now use explicit data type, partial_colour_ramp(), encode color ramps origin colors, provide ramp_colours() function applying colour ramps. make easier pass explicit color ramps without using scale functions, packages building {ggdist} use colour ramp scales (#209). Minor changes: default histogram bin selection algorithm now \"Scott\" instead \"Sturges\", \"Sturges\" tends conservative (#214). parameter stat_spike() (names) now determines values computed variable, can mapped onto aesthetics via after_stat() easily label spikes. (#203; thanks @mattansb suggestion). arrow parameter now supported intervals geom_slabinterval() (#206; thanks @ASKurz suggestion). default value overflow geom_dotsinterval() now new \"warn\" mode, works \"keep\" except warns users dots overflow geometry bounds suggests solutions (#213). Optional arguments automatically partially-applied functions can now passed waiver() use default value (see auto_partial()). Several dependency reductions: removed {cowplot}, {purrr}, {forcats}, {palmerpenguins}, {modelr} Suggests; moved {tidyselect} {dplyr} Imports Suggests. latter two strictly necessary curve_interval() due use grouped data frames tidy selection specify columns conditional joint (use grouped data frames point_interval() less strictly necessary, used stats, easier avoid absolute dependency). Documentation: pkgdown documentation now includes online article thickness aesthetic comprehensive examples slab scaling works (#205). Bug fixes: Ensure Mode() works analytical constant distributions. Various fixes ensure compatibility {ggplot2} 3.5.0.","code":""},{"path":"http://mjskay.github.io/ggdist/news/index.html","id":"ggdist-331","dir":"Changelog","previous_headings":"","what":"ggdist 3.3.1","title":"ggdist 3.3.1","text":"CRAN release: 2023-11-27 New features enhancements: Use derivatives supplied transformations scales >= 1.2.2 make transformations densities reliable (r-lib/scales#341). New layout = \"bar\" geom_dotsinterval() provides better bar dotplots (thanks @sharoz feedback; #190). Bandwidth estimators (including default, bandwidth_dpi()) now fall back bandwidth_nrd0() fail, warning suggests trying dotplot histogram (failures tend happen data good candidate density plot first place) (#196). Much faster (C++) implementation Wilkinson dotplot binning, especially large dotplots. Bug fixes: Ensure scale_side_mirrored() supports start = \"left\" start = \"right\" Ensure geom_spike() draws point correct end line depending side. Future-proof guide_rampbar() ggplot2 > 3.4.2 (#186). Thanks @teunbrand. Future-proof minor tests ggplot2 > 3.4.2 (#187). Allow size aesthetic overridden geom_dots() legend. Ensure hdi() supports constants. (#194)","code":""},{"path":"http://mjskay.github.io/ggdist/news/index.html","id":"ggdist-330","dir":"Changelog","previous_headings":"","what":"ggdist 3.3.0","title":"ggdist 3.3.0","text":"CRAN release: 2023-05-13 Breaking changes: following changes, mostly due new default density estimators, may cause plots sample data change. Changes usually small, generally result accurate density estimation. Revert old behavior setting density = density_unbounded(bandwidth = \"nrd0\"). stat_slabinterval() now uses density_bounded() default density estimator, uses bounded density estimator also estimates bounds data. default bandwidth estimator also now bandwidth_dpi(), Sheather-Jones direct plug-estimator (stats::bw.SJ(..., method = \"dpi\")). changes may cause existing charts using densities change; usually slightly. changes worth , drastically improve accuracy density estimates, especially bounded data, little noticeable impact densities unbounded data. density_bounded() now estimates bounds data provided (.e. one bounds NA). See bounder_ functions (e.g. bounder_cdf(), bounder_cooke()) bounds estimation. Improved Mode() hdi() estimators based bounded density estimator. New features enhancements: Improved hdci() estimator using quantile estimation. Histograms now implemented using density_histogram(), histogram density estimator. Finer-grained control bin positions now possible using breaks argument (including new breaks_fixed() manually-specified bin widths) align argument (including new align_boundary() align_center() choosing align bin positions reference points). (#118) New geom_spike() stat_spike() adding spike annotations slabs created geom_slabinterval() stat_slabinterval(). See example vignette(\"slabinterval\"). (#58, #124) parse_dist() now outputs distributional objects .dist_obj column addition name-plus-arguments (.dist+.args) format, objects respect truncation parameters prior specifications. makes easier visualize standard deviation priors, example, giving better solution #20. marginalize_lkjcorr() adjusts .dist_obj column output parse_dist() addition .dist .args columns. geom_lineribbon() now obeys order aesthetic, allowing arbitrarily set draw order ribbons (#171). Enabled change, stat_lineribbon() now sets order = after_stat(level) default, making draw order correct ensuring ribbons level drawn together. improved error messages using cli. experimental adaptive KDE available adapt parameter; note unsupported implementation interface highly likely change. Deprecations: slab_type parameter stat_slabinterval() now deprecated favor mapping corresponding computed variable (pdf cdf) onto desired aesthetic. slab_type = \"histogram\", use pdf computed variable combined new density_histogram() density estimator (e.g. set density = \"histogram\"). (#165) Bug fixes: Ensure scale transformations work even slab present; e.g. stat_interval(). (#168) Ensure curve_interval() works posterior::rvars. (#158) geom_lineribbon() draw order now correct even portions ribbon NA widths. (#171) Improve appearance logical fill conditions bin edges histograms. (#175)","code":""},{"path":"http://mjskay.github.io/ggdist/news/index.html","id":"ggdist-321","dir":"Changelog","previous_headings":"","what":"ggdist 3.2.1","title":"ggdist 3.2.1","text":"CRAN release: 2023-01-18 New features enhancements: Support non-numeric distributions stat_slabinterval() stat_dotsinterval(), including dist_categorical(), dist_bernoulli(), upcoming posterior::rvar_factor() type. (#108) new layout = \"hex\" allows hexagonal circle-packing style layout (#161). new mechanism smoothing dotplots using smooth parameter, including smooth = \"bounded\" / smooth = \"unbounded\" (“density dotplots”) smooth = \"discrete\" / smooth = \"bar\" (improved layout large-n discrete distributions). (#161) better bin/dot-nudging algorithm using constrained optimization (#163) new overlaps = \"keep\" option disables bin/dot nudging \"bin\", \"hex\", \"weave\" layouts. means layout = \"weave\" overlaps = \"keep\" yield exact dot positions. (#161) \"weave\" layout now works properly side = \"\" fixed binning artifacts high density edges, particularly right edges (#144) use max binwidth 1 discrete distributions (#159) new overflow = \"compress\" allows layouts compressed fit geom bounds user-specified binwidth otherwise cause dots exceed geom bounds. (#162) Two new shortcut geoms geom_dotsinterval(): geom_swarm() geom_weave(). can used quickly create “beeswarm”-like plots. new “mirrored” scale side aesthetic, scale_side_mirrored(), makes easier create mirrored slabs dotplots. (#142) Custom density estimators can now used stat_slabinterval() via density argument, including new bounded density estimator (density_bounded()). (#113) interval_size now linewidth slab_size now slab_linewidth geom_slab(), geom_dots(), geom_lineribbon(), size now linewidth new experimental mini domain-specific language probability expressions ggdist stats: Pr_() p_() functions can used generate after_stat() expressions terms ggdist computed variables; e.g. aes(thickness = !!Pr_(X <= x)) maps CDF distribution onto thickness aesthetic; aes(thickness = !!p_(x)) maps PDF onto thickness aesthetic. (#160) Several function families ggdist now use “currying” (automatic partial function application). function families partially apply non-optional arguments supplied: point_interval(), smooth_..., density_.... See help(\"automatic-partial-functions\"). Performance improvements point_interval() grouped data frames. (#154) Documentation: Uses stat() replaced after_stat() consistent deprecation stat() ggplot2 3.4.","code":""},{"path":"http://mjskay.github.io/ggdist/news/index.html","id":"ggdist-320","dir":"Changelog","previous_headings":"","what":"ggdist 3.2.0","title":"ggdist 3.2.0","text":"CRAN release: 2022-07-19 New features enhancements: .width level computed variables can now used slab / dots sub-geometries. values correspond smallest interval computed interval sub-geometry containing portion slab. gives flexible alternative using cut_cdf_qi() create densities filled according set intervals (approach also works highest-density intervals, cut_cdf_qi() ). Examples vignette(\"slabinterval\") updated use new approach, example added vignette(\"dotsinterval\") showing color dots intervals. experimental feature (currently bit fragile) enabled via options(ggdist.experimental.slab_data_in_intervals = TRUE), pdf cdf computed variables can now used interval sub-geometries get PDF CDF point summary. pdf_min, pdf_max, cdf_min, cdf_max also give PDF CDF lower upper ends interval. example vignette(\"lineribbon\") shows use make lineribbon gradients whose color approximates density (opposed classic gradient fan chart examples already vignette, color approximates CDF). scale_thickness_shared() now provided allow thickness scale shared across geometries, making certain plot types easier create (e.g. plots prior posterior densities together). See vignette(\"slabinterval\") example. thickness less 0 normalized minimum zero normalization turned ; makes easier use slab functions go zero. new example vignette(\"slabinterval\") shows use create raindrop plots. stacking order dots within bins geom_dotsinterval(layout = \"bin\") can now set using order aesthetic. makes possible create “stacked” dotplots mapping discrete variable onto order aesthetic (#132). part change, bin_dots() now maintains original data order within bins layout = \"bin\". See example vignette(\"dotsinterval\"). new verbose = TRUE flag geom_dotsinterval() outputs selected binwidth data units normalized parent coordinates. may useful want start automatically-selected bin width adjust manually. Though note: just want scale selected bin width fit within desired area, probably better use scale, want provide constraints bin width, can pass 2-vector binwidth. expand argument stat_slabinterval() can now take length-two logical vector control expansion lower upper limits respectively (#129). Thanks @teunbrand. geom_dotsinterval() now supports family aesthetic setting font used display dots (based conversation @gdbassett). Experimental guide_rampbar() creating gradient-like legends continuous color/fill ramp scales, based ggplot2::guide_colorbar(). See example vignette(\"lineribbon\"). Bug fixes: NAs thickness aesthetic slab, now rendered gaps slab (#129). Fixed check empty x/y scales avoid extending scale cover 0/1 plotting distributional objects whose bulk lies outside region (nothing else plot).","code":""},{"path":"http://mjskay.github.io/ggdist/news/index.html","id":"ggdist-311","dir":"Changelog","previous_headings":"","what":"ggdist 3.1.1","title":"ggdist 3.1.1","text":"CRAN release: 2022-02-27 Bug fixes: string supplied point_interval argument stat_slabinterval(), function name searched calling environment ggdist package environment. latter ensures stats work ggdist loaded attached search path (#128).","code":""},{"path":"http://mjskay.github.io/ggdist/news/index.html","id":"ggdist-310","dir":"Changelog","previous_headings":"","what":"ggdist 3.1.0","title":"ggdist 3.1.0","text":"CRAN release: 2022-02-13 New features enhancements: stat_dist_... stats deprecated favor stat_... counterparts, now understand dist, args, arg1…arg9 aesthetics. xdist ydist can now used place dist aesthetic specify axis one mapping distribution onto (dist may deprecated future). Passing dist-like objects x y aesthetics now raise helpful error message suggesting probably want use xdist ydist. Restructured internals stats geoms makes much easier maintain shortcut geoms stats, eliminating large amount code duplication (#106). New expand parameter stat_slabinterval() allows explicitly setting whether slab expanded limits scale (rather implicitly setting based slab_type). part , multivariate distribution objects rvars generate .index column passed point_interval() functions (#111). Based suggestion @mitchelloharawild. New stat_ribbon() provided shortcut stat stat_lineribbon() line (#48). Also, supply x y aesthetic geom_lineribbon(), get ribbons without line (#127). One-sided intervals (.e. quantiles) can now calculated using ul() (upper limit) ll() (lower limit), e.g. point_interval() explicitly via mean_ll(), median_ll(), mode_ll(), mean_ul(), median_ul(), mode_ul() (#49). Constant distributions now reliably detected variety situations rendered point masses density plots histograms (#103, #32). Minor improvements automatic bin width selection; maximum dot stack height closer equal scale often. formerly-internal fudge factor 1.07 dot sizes now exposed default value dotsize parameter instead applied internally. fudge factor tends (opinion) make dotplots look bit better due visual distance circles, (think) better used explicit value implicit one, hence change. may create subtle changes plots use dotsize stackratio parameters, allows parameters precise geometric interpretation. Documentation: New vignette stat_dotsinterval() sub-family: vignette(\"dotsinterval\") (#120). Vastly improved expanded documentation stat_slabinterval() geom_slabinterval() family: shortcut stat/geom now documentation page comprehensively lists parameters, aesthetics, computed variables, including pulled via ... typically-paired geoms. docs auto-generated easy maintain going forward. (#36) stat_lineribbon() geom_lineribbon() family now also separate documentation pages comprehensive listing aesthetics parameters (#107). Ridge plot-like example vignette(\"slabinterval\") using new expand parameter (#115). Deprecations removals: .prob argument, long-deprecated alias .width, removed. limits_function, limits_args, slab_function, slab_args, interval_function, interval_args arguments stat_slabinterval() removed: largely internal-use parameters needed subclasses base class creating shortcut stats, yet added lot noise documentation, replaced $compute_limits(), $compute_slabs(), $compute_intervals() methods new AbstractStatSlabinterval internal base class. Bug fixes: Improved handling NAs analytical distributions. Fixed bug within-bin order dots dotplots \"bin\" \"weave\" layouts incorrect aesthetics mapped sub-bin level. stackratios equal 1 now accounted find_dotplot_binwidth() (.e. automatic dotplot bin width selection). Ensure distinct fill colors lineribbons still treated distinct grouping even fill_ramp aesthetic ramps color.","code":""},{"path":"http://mjskay.github.io/ggdist/news/index.html","id":"ggdist-301","dir":"Changelog","previous_headings":"","what":"ggdist 3.0.1","title":"ggdist 3.0.1","text":"CRAN release: 2021-11-30 Bug fixes: Forward-compatibility fixes distributional >= 0.2.2.9000 (#91). Allow densities samples size 1 stat_sample_slabinterval() (#98). Avoid NOTE missing linearGradient() function R < 4.1. draw legend components inactive sub-geoms geom_slabinterval().","code":""},{"path":"http://mjskay.github.io/ggdist/news/index.html","id":"ggdist-300","dir":"Changelog","previous_headings":"","what":"ggdist 3.0.0","title":"ggdist 3.0.0","text":"CRAN release: 2021-07-19 Breaking changes: positioning geom_slabinterval() family geoms using position_dodge() now slightly different order match geoms positioned (#85). may slightly change existing charts use position = \"dodge\", cases may cause slabs drawn slightly outside plot boundaries, makes much easier combine geom_slabinterval() geoms expected way. dodging similar old approach needed, use new “justification-preserving dodge”, position_dodgejust(), place position_dodge(). New features: geom_slabinterval(), side, justification, scale can now used aesthetics instead parameters, allowing vary across slabs within geom. Varying fills within slab geom_slabinterval() can now drawn true gradients rather segmented polygons R >= 4.1 setting fill_type = \"gradient\". substantially improves appearance gradient fills graphics engines support (#44). stat_dist_slabinterval() company now detect discrete distributions display histograms (#19). geom_dotsinterval() now adjusts bin widths discrete distributions result bins taller allocated space ensure fit within required space (#42). Allow user-specified lower /upper bounds dynamic geom_dotsinterval() bin width passing vector two values binwidth parameter. automatic bin selection algorithm used geom_dotsinterval() factored exported find_dotplot_binwidth() bin_dots() others use (#77). Previously, curve_interval() used common (naive) approach finding cutoff data depth identify X% “deepest” curves, simply taking envelope around X% quantile curves ranked depth. quite conservative tends create intervals wide; curve_interval() now searches cutoff data depth X% curves contained within envelope (#67). point_interval() company now accept distributional objects posterior::rvar()s (full support distributional objects requires distributional > 0.2.2). Reduce dependencies substantially, making geoms suitable use packages (thanks Brenton Wiernik help). New documentation: Substantial improvements documentation aesthetics computed variables geom_slabinterval(), stat_slabinterval(), company, listing custom aesthetics, computed variables, usage. Several new examples vignette(\"slabinterval\"), including “rain cloud” plots example histograms discrete analytical distributions. Bug fixes: Ensure stat_dist_slabinterval() preserves group order (#88). Improve test coverage ~96%. Restore computed variable n stat_sample_slabinterval(). Various improvements correct NA handling across geoms (#74, #51).","code":""},{"path":"http://mjskay.github.io/ggdist/news/index.html","id":"ggdist-241","dir":"Changelog","previous_headings":"","what":"ggdist 2.4.1","title":"ggdist 2.4.1","text":"CRAN release: 2021-06-10 New features: Added \"weave\" \"swarm\" layouts dots geoms (#64). provide alternative layouts keep datapoints actual positions data axis. \"weave\" layout maintains rows columns works well quantile dotplots; \"swarm\" layout uses \"compactswarm\" method beeswarm::beeswarm() (courtesy James Trimble) works well sample data. See dotplot section vignette(\"slabinterval\") comparisons. Allow use unit() specify bin widths manually dots geoms stats, can helpful need dotplots across facets bin width (#53). New documentation: Add example lineribbon gradients using fill_ramp vignette(\"lineribbon\"). Add example Tukey-like pencils vignette(\"slabinterval\"). Add example two slab used together (densities dotplots make “rain clouds”) vignette(\"slabinterval\"). Bug fixes: Fix issues ggplot2 3.3.4 (#72) vdiffr 1.0. Handle interactions alpha fill/color properly set user (#62). Use step function ECDFs, also fix constant CDFs (#55). Move fda suggests brings large number dependencies rarely used. Use trimmed density mode estimation (#57).","code":""},{"path":"http://mjskay.github.io/ggdist/news/index.html","id":"ggdist-240","dir":"Changelog","previous_headings":"","what":"ggdist 2.4.0","title":"ggdist 2.4.0","text":"CRAN release: 2021-01-04 New features: add pdf cdf computed variables stat_sample_slabinterval() subfamily. See new examples usage last section vignette(\"slabinterval\"). (#11) add cut_cdf_qi() creating (amongst things) interval-filled halfeyes, style bayesplot::mcmc_areas() (#11) add fill_ramp color_ramp scales geom_slabinterval() geom_lineribbon() families, making easier separate group colors interval/density/CDF colors. See new examples vignette(\"slabinterval\"), vignette(\"lineribbon\"), vignette(\"freq-uncertainty-vis\"). (#16) auto-detect finite limits analytical distributions, (e.g.) distributions like beta cut tails close 0 1. (#18) add brms::brmsprior implementation parse_dist() (#34) New documentation: vignette(\"freq-uncertainty-vis\") now uses distributional::dist_student_t() (#14) add references fuzzygrams vignette(\"slabinterval\") (#23) add examples separate positioning slab interval (#27) add discussion limitations curvewise intervals vignette(\"lineribbon\") (#22) soft-deprecate usage interval_size_range argument docs (#35) initial versions cheat sheets Bug fixes: add limited na.rm support curve_interval() (#22) use analytical instead numerical derivatives scale transformations possible, improving reliability.","code":""},{"path":"http://mjskay.github.io/ggdist/news/index.html","id":"ggdist-230","dir":"Changelog","previous_headings":"","what":"ggdist 2.3.0","title":"ggdist 2.3.0","text":"CRAN release: 2020-10-30 New features documentation: Add curve_interval() generating curvewise (joint) intervals curve boxplots (#22) Add vignette(\"lineribbon\") describing geom_lineribbon(), stat_lineribbon(), stat_dist_lineribbon(), curve_interval(). Bug fixes: Support dist aesthetics factors (#25) Fix slab drawing order overlapping (ggridges-style) slabs (#30) Workaround changes {distributional} distribution functions #31 fixed.","code":""},{"path":"http://mjskay.github.io/ggdist/news/index.html","id":"ggdist-220","dir":"Changelog","previous_headings":"","what":"ggdist 2.2.0","title":"ggdist 2.2.0","text":"CRAN release: 2020-07-12 Support distributional, including new examples vignette(\"slabinterval\") (#14). stat_dist_... geoms now calculate pdf cdf columns allow mashup geoms involve functions, Correll-style gradient plots combined violins, Helske et al. (#11). stat_dist_... geoms now work gganimate (#15). Examples updated fix errors introduced broom::augment() defaulting se_fit = FALSE.","code":""},{"path":"http://mjskay.github.io/ggdist/news/index.html","id":"ggdist-211","dir":"Changelog","previous_headings":"","what":"ggdist 2.1.1","title":"ggdist 2.1.1","text":"CRAN release: 2020-06-14 Initial split tidybayes: ggdist now contains stats/geoms tidybayes (except deprecated ones), support functions stats/geoms (point_interval()), vignette(\"slabinterval\"), vignette(\"freq-uncertainty-vis\"). Tidybayes retain functions, re-export ggdist functions now. stats geoms now support automatic orientation determination. Thus, h-suffix geoms now deprecated. geoms left tidybayes give deprecation warning used; used ggdist directly. geom_interval(), geom_pointinterval(), geom_lineribbon() longer automatically set ymin ymax aesthetics .lower .upper present data. allows work better automatic orientation detection (bad feature existed first place anyway). deprecated tidybayes::geom_intervalh() tidybayes::geom_pointintervalh() still automatically set aesthetics, since deprecated anyway (supporting old behavior fine functions). geom_lineribbon()/stat_lineribbon() now supports step argument creating stepped lineribbons. H/T Solomon Kurz suggestion. ggdist now implementation scaled shifted Student’s t distribution (dstudent_t(), qstudent_t(), etc), since useful visualizing confidence distributions.","code":""}]
