Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aurielfournier/3846fbc2bc8dd10ea60f9fdeb4d3f03f to your computer and use it in GitHub Desktop.
Save aurielfournier/3846fbc2bc8dd10ea60f9fdeb4d3f03f to your computer and use it in GitHub Desktop.
library(ggplot2)
library(tidyverse)
faithful$group <- factor(ifelse(faithful$eruptions>3, 1, 0))
subfaith <- faithful %>% filter(group=="1")
ggplot(data=faithful,aes(waiting, eruptions, color = group)) +
geom_point() +
stat_ellipse(data=subfaith,aes(waiting, eruptions, color = group))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment