plot_norm | R Documentation |
Draw a normal distribution curve and optional shading of a particular region.
plot_norm( mean = 0, sd = 1, shadeValues = NULL, direction = c("less", "greater", "beyond", "between"), col.shade = "cornflowerblue", ... )
mean |
The mean of the normal distribution to plot (mu) |
sd |
The standard deviation of the normal distribution to plot (sigma) |
shadeValues |
Either a single number or a vector of two numbers which identify the boundary or boundaries of the shaded region |
direction |
A character string (in quotes) indicating the direction from
shadeValues to shade under the normal curve. Must be one of " |
col.shade |
The color of the shaded region |
... |
Other graphical parameters passed to plot (e.g.,
|
The direction
argument is used to control the region under
the normal distribution curve which is shaded. If shadeValues
is a
single number, direction
must be either "less
" (in which case
the shaded region will be to the left of shadeValues
) or
"greater
" (the shaded region will be to the right of
shadeValues
).
If shadeValues
is a vector, then direction
must be either "between
"
(the region between the two numbers in shadeValues
will be shaded) or
"beyond
" (the region below the smaller and above the larger of the
shadeValues
will be shaded).
A plot of a normal distribution curve with optional shading.
plot_t
# Probability of a value being between 3 and 3.5 in a N(3.39, 0.55) distribution plot_norm(mean = 3.39, sd = 0.55, shadeValues = c(3, 3.5), direction = "between", col.shade = "forestgreen") # Probability of a value being greater than 1.96 in a N(0, 1) distributio plot_norm(shadeValues = 1.96, direction = "greater", col.shade = "peachpuff")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.