Description Usage Arguments Details Value Author(s) Examples
Plot a beta density
1 |
alpha |
the beta's alpha parameter |
beta |
the beta's beta parameter |
n |
number of points to plot |
... |
... |
plotBeta creates a basic ggplot which can be styled.
a ggplot object
David Kahle david.kahle@gmail.com
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 | ## Not run:
plotBeta(1, 1)
plotBeta(.5, .5)
plotBeta(2, 2)
plotBeta(2, 2:3)
# nonuniqueness of modes
plotBeta(4.5, 7.5) + ylim(0, 3)
plotBeta(1.12, 1.22) + ylim(0, 3)
plotBeta(c(4.5, 1.12), c(7.5, 1.22)) + ylim(0, 3)
plotBeta(.5, .5) + theme_bw()
plotBeta(.5, .5) + theme_classic()
theme_set(theme_bw())
plotBeta(.5, .5) + labs(x = "theta", y = "")
plotBeta(.5, .5) + ggtitle("my plot")
plotBeta(.5, .5) + labs(x = expression(theta[1]), y = "belief")
plotBeta(.5, .5) + labs(x = expression(paste(theta[1], "= 5")), y = "belief")
plotBeta(.5, .5) + labs(x = expression(paste(theta[1], "= ", 5)), y = "belief")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.