# default settings for normally distributed data, (5%,95%) interval,
data <- data.frame(x = rep(c(1, 2, 3), each = 20),
y = rep(c(1, 2, 3), each = 20) + stats::rnorm(60),
group = rep(1:3, 20))
xgx_plot(data, ggplot2::aes(x = x, y = y)) +
xgx_stat_pi(percent_level = 0.95)
# try different geom
xgx_plot(data, ggplot2::aes(x = x, y = y)) +
xgx_stat_pi(percent_level = 0.95, geom = list("errorbar", "point", "line"))
# including multiple groups in same plot
xgx_plot(data, ggplot2::aes(x = x, y = y)) +
xgx_stat_pi(percent_level = 0.95,
ggplot2::aes(color = factor(group), fill = factor(group)),
position = ggplot2::position_dodge(width = 0.5))
# including multiple percent intervals in same plot
xgx_plot(data, ggplot2::aes(x = x, y = y)) +
xgx_stat_pi(percent_level = 0.90) +
xgx_stat_pi(percent_level = 0.80) +
xgx_stat_pi(percent_level = 0.70) +
xgx_stat_pi(percent_level = 0.60)
Run the code above in your browser using DataLab