I have trouble in setting the color of an outlier in a stripchart. I tried two method, but neither worked.
Here is the code:
x = rnorm(30)
x[20]=10
# 1
stripchart(x,main='Outlier Plot',xlab='x', pch=20, col=ifelse(x==10, 'red', 'blue'))
# 2
cols = rep('blue',length(x))
cols[which(x==10)]='red'
stripchart(x,main='Outlier Plot',xlab='x', pch=20, col=cols)
The colors are all blue with no change.
The expected plot was shown in the minitab link:
points() does not work with stripchart. So use stripchart() with the option 'add=TRUE'