Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2015
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. library(mosaic)
  2. n=300
  3. r =c(seq(1,15,1))
  4. binwidth = 1
  5. outliers= c(100,400,800,700)
  6. #outliers= c(15,14,3,5)
  7. dat = c(sample(r ,n= 1,size = n, replace = TRUE),outliers)
  8. quantile(dat)[4]+1.5* IQR(dat)
  9. n=n+4
  10. 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)
  11. d = data.frame( x = dat, color = c(rep("red",n/2), rep("green",n/2)))
  12. 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