Guest User

Untitled

a guest
Apr 25th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. myboxplot <- function(x, horizontal = TRUE){
  2. q25 <- quantile(x, 0.25, type=2);
  3. q75 <- quantile(x, 0.75, type=2);
  4. iqr <- q75-q25;
  5. u.zaun <- q25-1.5*iqr;
  6. o.zaun <- q75+1.5*iqr;
  7. u.anrainer <- min(q25, x[x>=u.zaun & x<=q25]);
  8. o.anrainer <- max(q75, x[x>=q75 & x<=o.zaun]);
  9. u.ausr <- x[x<u.zaun];
  10. o.ausr <- x[x>o.zaun];
  11. ausr <- c(u.ausr, o.ausr);
  12. b.stats <- boxplot(x, plot=FALSE);
  13. b.stats[[1]][1,1] <- u.anrainer;
  14. b.stats[[1]][2,1] <- q25;
  15. b.stats[[1]][4,1] <- q75;
  16. b.stats[[1]][5,1] <- o.anrainer;
  17. b.stats[[4]] <- ausr;
  18. b.stats[[5]] <- rep(1, length(ausr));
  19. bxp(b.stats, horizontal = horizontal);
  20. }
Add Comment
Please, Sign In to add comment