# ----------------------------------------------------------------------------- # title: Boosted Boxplots # description: add several useful features to the classical R boxplot function # author: Alassane Samba (alassane.samba@orange.com) # Copyright (c) 2016 Orange # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 # ----------------------------------------------------------------------------- boostedBoxplot<-function(y,x, main="", labx=NULL,laby=NULL, plot.mean=T, text.freq=T, las=1, ylim=c(0,0), limitVisibleModalities=30, decreasing=NULL, dynamic=F){ xlab="" if(is.null(labx))labx=deparse(substitute(x)) if(is.null(laby))laby=deparse(substitute(y)) if(main==""){ main=labx }else{ xlab=labx } x=droplevels(as.factor(x)) p=length(levels(as.factor(x))) if(!is.null(decreasing)){ x=factor(x,levels = names(sort(tapply(y,x,median), decreasing = decreasing)), ordered = F) }else{ decreasing=T } #limitVisibleModalities if(limitVisibleModalities