Created
October 24, 2024 04:17
-
-
Save benmarwick/da75e66d8a8e989ba0ff4f19e58c54e4 to your computer and use it in GitHub Desktop.
what is the correct boxplot for this histogram?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data <- tibble( x = c( | |
# Peak 1 (around 0-2) | |
rep(1, 50), rep(2, 30), rep(3, 20), | |
# Dip (middle values) | |
rep(4, 10), rep(5, 8), rep(6, 8), rep(7, 10), | |
# Peak 2 (around 10-12) | |
rep(8, 20), rep(9, 30), rep(10, 50) | |
)) | |
ggplot(data) + | |
aes(x) + | |
geom_histogram(bins = 10) | |
ggplot(data) + | |
aes(x) + | |
geom_boxplot() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's the question:
Here's the histogram I can make to reproduce the question:
Here's the boxplot of the same data: