Draw a weighted Boxplot. (Beta Version)
box.plot.wtd(x, group=NULL, group2=NULL, w=NULL, data=NULL, vnames=NULL,
main=NULL, xlab=NULL, ylab=NULL, ylim=NULL, yticks=NULL,
col=NULL, tcol=NULL, bgcol=NULL, lcol=NULL, pdigs=4, alpha=NULL,
cex=1, cex.axis=1, lwd=2, h=NULL, lty=2,
varwidth=TRUE, means=FALSE, count=TRUE, zylinder=FALSE,
outlier=TRUE, wall=0, type='box')
a numeric vector of values
a character string with the name of the variable in the data.frame
a formula x~group or x~group+group2
a factor to group the plots
a character string with the name of the group variable in the data.frame
a second factor to group the plots
a character string with the name of the group2 variable in the data.frame
weights
a data.frame
a vector of character strings with the names of groups in the legend, it can be a list of two vectors if group2 is given
an overall title for the plot
a title for the x axis
a title for the y axis
the y limits (y1, y2) of the plot
the number of ticks on the y axis or a vector of exact ticks
color of objects (Boxes)
color of the text in whole plot
the background color for plot dekoration
color for the lines in plot, a vector of colors is possible
a number indicate how to round p-values.: see ?format.pval.ade
a parameter in [0, 1] for semi-transparency of objects (Boxes)
a numeric character expansion factor for the points
a numeric character expansion factor for axis
the line width
the y-value(s) for horizontal line(s).
the line type
logical asking whether the boxwidth indicate the N
logical asking whether to draw points for the means
logical asking whether to shown N
a string to replace N with it, if you use "?" in you string in will be replaced with N.
a vector of strings to replace N with it, if you use "?" in you strings in will be replaced with N.
logical asking whether to draw boxes in a zylinder style
logical asking whether to draw points for outlier
a number between 0 and 6 for selection the dekoration style of the plot.
one of following:
"boxplot" for a normal boxplot
"sd" for mean and one sd interval
"2sd" for mean and one, two sd intervals
"iqr" for a IQR plot
x<-rnorm(1000)
g<-round(runif(1000))
w<-abs(rnorm(1000))
d<- data.frame(x, g, w)
box.plot.wtd('x', 'g', w='w', data=d)
Run the code above in your browser using DataLab