Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(tidyverse)
- x <- c(20, 28, 30, 35, 41, 50, 51, 57, 60, 65,
- 66, 70, 71, 71, 75, 78, 80, 80, 81, 82,
- 84, 85, 85, 86, 87, 90, 91, 94, 95, 98,
- 99, 100, 100)
- df <- data.frame(x)
- # density curve
- ggplot(df, aes(x = x)) +
- geom_density() +
- geom_rug() # shows the raw scores on the x-axis
- # cumulative density curve
- ggplot(df, aes(x = x)) +
- stat_ecdf(geom = "smooth")
Add Comment
Please, Sign In to add comment