draw | R Documentation |
By providing X and their probability, you can draw either CDF or PMF
draw(
X,
p,
cumulative = F,
sort.prob = F,
round = 3,
show.label = TRUE,
nudge = 0
)
X |
Mishtane Mikri. Can be a vector of values. |
cumulative |
a logical. If TRUE: draws a CDF. default is set to FALSE. |
sort.prob |
a logical. Concerns the data frame returned, if TRUE: sort by probability (in decreasing order), Otherwise same order as input of X. default is set to FALSE. |
round |
How many decimals to show. Default is set to 3. |
show.label |
A logical. Default (TRUE) prints probability labels on the plot. |
nudge |
When |
P |
Probability. Should be the same length as X (also vectorized). |
graph
(Print only).
Tohelet and Shonut
(Print only).
data.frame
of X and their probs (use sort.prob
to change order method).
Probs can add up to more than 1, It will work, but not advised and a warning message will appear. Negative probs will be automatically corrected to absolute value.
For a fully detailed explanation about the differences between distributions please visit https://www.researchgate.net/post/What-is-the-difference-between-probability-distribution-function-and-probability-density-function
x <- c(1:5)
p <- c(0.1,0.2,0.25,0.25,0.2)
draw(x,p)
draw(x,p,cumulative=TRUE, sort.prob=TRUE)
dice <- 1:6
draw(dice,-1/6)
## Even when using negative probability, it will work.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.