'Creating a ggplot boxplot with jitter duplicates my data (R) [duplicate]
I want to create a boxplot that shows individual data points as well. This is the code that I am using:
ggplot(data, aes(x=treatment, y=aggregate_count, color = treatment)) +
geom_boxplot() +
geom_point(position = "jitter") +
ylab("Aggregate Count") +
xlab("") +
theme_classic()

Using both the geom_boxplot() and geom_point() function together like this however duplicates my dataset. I noticed this because there is only one value in my dataset with a value above 30, but in the plot, I can see two. If I remove either geom_boxplot() or geom_point() the data gets displayed correctly.
Does someone have an idea on how to fix this?
Thank you in advance!!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
