# adds 90% confidence ellipse with semi-transparent area over two clusters of points
library(mdatools)
data(people)
group <- factor(people[, "Sex"], labels = c("Male", "Female"))
# first make plot and then add confidence ellipse
p <- mdaplot(people, type = "p", cgroup = group)
plotConfidenceEllipse(p, conf.level = 0.90, opacity = 0.2)
Run the code above in your browser using DataLab