View source: R/plot_functions.R
| bar_error | R Documentation |
bar_error constructs bar charts in with error bars showing 95
confidence intervals around mean values. High of bars represent mean values.
bar_error(data, x, y, alpha = 0.7)
data |
A data frame. |
x |
A variable in the data frame. |
y |
A variable in the data frame |
alpha |
Opacity of the colour fill (0 = invisible, 1 = opaque). |
require(dplyr, quietly = TRUE)
require(sjlabelled, quietly = TRUE)
data(birthwt, package = "MASS")
birthwt <- birthwt |>
mutate(
smoke = factor(smoke, labels = c("Non-smoker", "Smoker"))
) |>
var_labels(
bwt = "Birth weight (g)",
smoke = "Smoking status"
)
birthwt |>
bar_error(x = smoke, y = bwt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.