Description Usage Arguments Examples
If you have lower & upper points associated with your line in a data frame,
you can specify their accessors (defaults to "l"
& "u"
) here
which will result in a shaded confidence band being plotted with the line.
1 | mjs_add_confidence_band(mjs, lower_accessor = "l", upper_accessor = "u")
|
mjs |
metricsgraphics plot object |
lower_accessor |
bare or quoted name of column to use for the lower bound of the confidence band |
upper_accessor |
bare or quoted name of column to use for the upper boudn of the confidence band |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | require(binom)
require(dplyr)
set.seed(1492)
binom.confint(x=sample(2:30, 100, replace=TRUE), n = 100, tol = 1e-8,
methods="bayes") %>%
mutate(x=1:100) -> bdat
bdat %>%
mjs_plot(x=x, y=mean, width=600, height=240) %>%
mjs_axis_x(show_secondary_x_label=FALSE,
extended_ticks=TRUE) %>%
mjs_line() %>%
mjs_add_confidence_band(lower_accessor="lower",
upper_accessor="upper")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.