View source: R/anypfcdfdiscrete.R
apf | R Documentation |
Help in building the plot of the probability function of any discrete variable
apf(x, p, main = NULL, xlab = NULL, ylab = NULL)
x |
numeric vector of values of |
p |
numeric vector of |
main |
main title for the plot. |
xlab |
a label for the x axis. |
ylab |
a label for the y axis. |
Consider the X
distribution:
p_X(x) : | 0.23 | 0.27 | 0.30 | 0.12 | 0.08 |
x : | 1 | 2 | 3 | 4 | 5 |
where p_X(x)
and x
are probability function and values of X
. See Example 1.
The output is plot of distribution function. See Example 1.
# Example 1
x <- 1:5
p <- c(0.23, 0.27,0.30, 0.12, 0.08)
apf(x, p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.