Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(mosaic)
- n=300
- r =c(seq(1,15,1))
- binwidth = 1
- outliers= c(100,400,800,700)
- #outliers= c(15,14,3,5)
- dat = c(sample(r ,n= 1,size = n, replace = TRUE),outliers)
- quantile(dat)[4]+1.5* IQR(dat)
- n=n+4
- brks = c(seq(0,sd(dat)*2,binwidth),tail(seq(0,sd(dat)*2,binwidth),1)+binwidth,tail(seq(0, max(dat),binwidth),1)+binwidth)
- d = data.frame( x = dat, color = c(rep("red",n/2), rep("green",n/2)))
- dotPlot(d$x, breaks = seq(min(d$x)-binwidth,max(d$x)+binwidth,binwidth), cex = .5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement