I am trying to get rid of outliers in my graph that contains a boxplot and a beeswarm.
I create the boxplot with the following code:
boxplot(Lead_s ~ Group, data = g, outline = FALSE,
main = 'Gaze shift duration with co-occuring movement units',
horizontal=TRUE,xlab = "Gaze lead (sec)")
With the outline=FALSE
my outliers disappear.
Then, I run this code to get my data points in form of the bee swarm.
beeswarm(Lead_s ~ Group, data = g, col = 4, pch = 16,
add = TRUE,horizontal=TRUE,pwcol = 1 + as.numeric(Lead_s))
The boxplot with the bee swarm:
What happens is that the outliers
are plotted outside of the graph. Whether I add outline=FALSE
or not, the outliers are still there.
This is the data sample I plotted:
Group Lead_s
Non-Performers 1
Non-Performers 3
Expert 18
Non-Performers 0.1
Non-Performers 0.1
Non-Performers 0.1
Non-Performers 0.2
Non-Performers 0.2
Non-Performers 0.3
Expert 0.4
Non-Performers 0.4
Non-Performers 0.4
Expert 0.5
Non-Performers 0.5
Non-Performers 0.6
Non-Performers 0.6
Non-Performers 0.7
Expert 0.8
Non-Performers 0.8
Expert 1.1
Expert 1.1
Non-Performers 1.1
Expert 1.3
Non-Performers 1.3
Non-Performers 1.4
Non-Performers 1.4
Non-Performers 1.4
Non-Performers 1.5
Expert 1.7
Expert 1.9
Non-Performers 1.9
Expert 2.1
Non-Performers 2.1
Non-Performers 2.1
Non-Performers 2.1
Non-Performers 2.3
Expert 2.5
Expert 2.7
Expert 2.7
Non-Performers 3.1
Expert 4.1
Expert 4.5
Non-Performers 5.6
Non-Performers 6.7
Any ideas how can I fix it?