-
Notifications
You must be signed in to change notification settings - Fork 25
/
blur.Rd
executable file
·62 lines (54 loc) · 2.2 KB
/
blur.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geom_blur_dots.R
\name{blur}
\alias{blur}
\alias{blur_gaussian}
\alias{blur_interval}
\title{Blur functions for blurry dot plots}
\usage{
blur_gaussian(x, r, sd)
blur_interval(x, r, sd, .width = 0.95)
}
\arguments{
\item{x}{numeric vector of positive distances from the center of the dot
(assumed to be 0) to evaluate blur function at.}
\item{r}{radius of the dot that is being blurred.}
\item{sd}{standard deviation of the dot that is being blurred.}
\item{.width}{for \code{blur_interval()}, a probability giving the width of
the interval.}
}
\value{
A vector of length \code{x} giving the opacity of the radial gradient representing
the dot at each \code{x} value.
}
\description{
Methods for constructing blurs, as used in the \code{blur} argument to
\code{\link[=geom_blur_dots]{geom_blur_dots()}} or \code{\link[=stat_mcse_dots]{stat_mcse_dots()}}.
Supports \link[=auto_partial]{automatic partial function application} with
\link[=waiver]{waived arguments}.
}
\details{
These functions are passed \code{x}, \code{r}, and \code{sd} when \code{\link[=geom_blur_dots]{geom_blur_dots()}}
draws in order to create a radial gradient representing each dot in the
dotplot. They return values between \code{0} and \code{1} giving the opacity of the
dot at each value of \code{x}.
\code{blur_gaussian()} creates a dot with radius \code{r} that has a Gaussian blur with
standard deviation \code{sd} applied to it. It does this by calculating
\eqn{\alpha(x; r, \sigma)}, the opacity at distance \eqn{x} from the center
of a dot with radius \eqn{r} that has had a Gaussian blur with standard
deviation \eqn{\sigma} = \code{sd} applied to it:
\deqn{
\alpha(x; r, \sigma) = \Phi \left(\frac{x + r}{\sigma} \right) -
\Phi \left(\frac{x - r}{\sigma} \right)
}
\code{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 \code{.width} and standard deviation \code{sd}.
}
\examples{
# see examples in geom_blur_dots()
}
\seealso{
\code{\link[=geom_blur_dots]{geom_blur_dots()}} and \code{\link[=stat_mcse_dots]{stat_mcse_dots()}} for geometries making use of
\code{blur}s.
}