| blur | R Documentation |
Methods for constructing blurs, as used in the blur argument to
geom_blur_dots() or stat_mcse_dots().
Supports automatic partial function application with waived arguments.
blur_gaussian(x, r, sd)
blur_interval(x, r, sd, .width = 0.95)
x |
<numeric> Vector of positive distances from the center of the dot (assumed to be 0) to evaluate blur function at. |
r |
<scalar numeric> Radius of the dot that is being blurred. |
sd |
<scalar numeric> Standard deviation of the dot that is being blurred. |
.width |
<scalar numeric> For |
These functions are passed x, r, and sd when geom_blur_dots()
draws in order to create a radial gradient representing each dot in the
dotplot. They return values between 0 and 1 giving the opacity of the
dot at each value of x.
blur_gaussian() creates a dot with radius r that has a Gaussian blur with
standard deviation sd applied to it. It does this by calculating
\alpha(x; r, \sigma), the opacity at distance x from the center
of a dot with radius r that has had a Gaussian blur with standard
deviation \sigma = sd applied to it:
\alpha(x; r, \sigma) = \Phi \left(\frac{x + r}{\sigma} \right) -
\Phi \left(\frac{x - r}{\sigma} \right)
blur_interval() creates an interval-type representation around the
dot at 50% opacity, where the interval is a Gaussian quantile interval with
mass equal to .width and standard deviation sd.
A vector with the same length as x giving the opacity of the radial
gradient representing the dot at each x value.
geom_blur_dots() and stat_mcse_dots() for geometries making use of
blur functions.
# see examples in geom_blur_dots()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.