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) |>
gf_star(x1 = 1, y1 = 10.9, x2 = 2, y2 = 11, y3 = 11.2)
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)
data(energy, package = "ISwR")
energy <- energy |>
var_labels(
expend = "Energy expenditure (MJ/day)",
stature = "Stature"
)
energy |>
strip_error(expend ~ stature, col = "red") |>
gf_star(1, 13, 2, 13.2, 13.4, "**")
Run the code above in your browser using DataLab