A function to draw a barplot
bar.plot.ade(x, y=NULL, z=NULL, data=NULL,
vnames.x=NULL, vnames.y=NULL, vnames.z=NULL,
btext=NULL, b=NULL, b2=0.5, v=NULL, h=NULL, gradient=FALSE,
xlab="", ylab="", main="", ylim=NULL,
yticks=NULL, col=NULL, tcol=NULL, bgcol=NULL, lcol=NULL,
alpha=NULL, beside=TRUE, legendon="topright", wall=0,
lhoriz=NULL, prozent=FALSE, ploc=0, form="r", border=TRUE,
density=NULL, angle=NULL, density2=NULL, angle2=NULL, fill=NULL,
lwd=1, lty=1, blwd=1, blty=1)
a factor
a string with the name of the factor variable in the data.frame
a formula x~y or x~y+z
a table
second factor
a string with the name of second factor in the data.frame
third factor
a string with the name of thirds factor in the data.frame
a data.frame
a vector of character strings with labels for the levels of x
a vector of character strings with labels for the levels of y
a vector of character strings with labels for the levels of z
logical asking whether to draw p-values from chisq test
a vector of character strings with test to draw over the bars
width of bars in [0, 1]
depth of 3d bars in [0, 1]
the x-value(s) for vertical line(s).
the y-value(s) for horizontal line(s).
logical asking whether to draw a color gradient
a title for the x axis
a title for the y axis
an overall title for the plot
the y limits (y1, y2) of the plot
the number of ticks on the y axis
color for the bars representing levels of y
color of the text in whole plot
the background color for plot dekoration
colors for the lines to shading bars, a vector is possible
a parameter in [0, 1] for semi-transparency of bars
logical asking whether to draw bars beside or on top
a single keyword from:
"bottomright"
"bottom"
"bottomleft"
"left"
"topleft"
"top"
"topright"
"right"
"center"
"none"
This places the legend on the inside of the plot frame at the given location. To locate 2 legends you can give a vector of 2 keywords.
a number between 0 and 6 for selection the dekoration style of the plot.
logical asking whether to draw legend horizontal
logical asking whether to draw percents on bars
Position of percents
0: middle
1, bottom
2: over
3: top
4: under
a single keyword from:
'r': Rects
'c', 3D Rects
'z': Zylinders (not working well)
logical asking whether to draw borders os bars
first density for shading lines, in lines per inch.
first angle (in degrees) for the shading lines.
second density for shading lines, in lines per inch.
second angle (in degrees) for the shading lines.
fill color for bars if used density, because the col parameter will be used for color of the shading lines.
width for shading lines
linetype for shading lines
width for bar-borders
linetype for bar-borders
bar3d.ade
x<- round(runif(1000, 0.5, 10.5))
bar.plot.ade(x, btext='Uniform distribution', gradient=TRUE)
x<-rbinom(1000, 1, 0.75)
y<-rbinom(1000, 1, 0.30)
z<-rbinom(1000, 1, 0.50)
bar.plot.ade(x,y,z)
bar.plot.ade(x,y,z, wall=4, form='c', main='Bar-Plot')
Run the code above in your browser using DataLab