View source: R/plot_functions.R
box_plot | R Documentation |
box_plot
is a wrap function that calls gf_boxplot
to construct more aesthetic box plots.
box_plot(
object = NULL,
formula = NULL,
data = NULL,
fill = "indianred3",
alpha = 0.7,
outlier.shape = 20,
outlier.size = 1,
...
)
object |
When chaining, this holds an object produced in the earlier portions of the chain. Most users can safely ignore this argument. See details and examples. |
formula |
A formula with shape: |
data |
A data frame where the variables in the |
fill |
Colour used for the box passed to |
alpha |
Opacity (0 = invisible, 1 = opaque). |
outlier.shape |
Shape ( |
outlier.size |
Size of the outlier symbol. |
... |
Further arguments passed to |
data(kfm, package = "ISwR")
require(sjlabelled, quietly = TRUE)
kfm <- kfm |>
var_labels(
dl.milk = "Breast-milk intake (dl/day)",
sex = "Sex",
weight = "Child weight (kg)",
ml.suppl = "Milk substitute (ml/day)",
mat.weight = "Maternal weight (kg)",
mat.height = "Maternal height (cm)"
)
kfm |>
box_plot(dl.milk ~ sex, fill = "thistle", alpha = 0.8)
t.test(dl.milk ~ sex, data = kfm)
kfm |>
box_plot(dl.milk ~ sex, fill = "thistle", alpha = 0.8) |>
gf_star(1, 10.9, 2, 11, 11.4, legend = "p = 0.035", size = 2.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.