Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- myboxplot <- function(x, horizontal = TRUE){
- q25 <- quantile(x, 0.25, type=2);
- q75 <- quantile(x, 0.75, type=2);
- iqr <- q75-q25;
- u.zaun <- q25-1.5*iqr;
- o.zaun <- q75+1.5*iqr;
- u.anrainer <- min(q25, x[x>=u.zaun & x<=q25]);
- o.anrainer <- max(q75, x[x>=q75 & x<=o.zaun]);
- u.ausr <- x[x<u.zaun];
- o.ausr <- x[x>o.zaun];
- ausr <- c(u.ausr, o.ausr);
- b.stats <- boxplot(x, plot=FALSE);
- b.stats[[1]][1,1] <- u.anrainer;
- b.stats[[1]][2,1] <- q25;
- b.stats[[1]][4,1] <- q75;
- b.stats[[1]][5,1] <- o.anrainer;
- b.stats[[4]] <- ausr;
- b.stats[[5]] <- rep(1, length(ausr));
- bxp(b.stats, horizontal = horizontal);
- }
Add Comment
Please, Sign In to add comment