bar.plot.wtd {epade} | R Documentation |
weighted Bar plot
Description
A function to draw a weighted or unweighted barplot
Usage
bar.plot.wtd(x, y=NULL, z=NULL, w=NULL, data=NULL,
vnames.x=NULL, vnames.y=NULL, vnames.z=NULL,
btext=NULL, cutz=F, zperc=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)
Arguments
x |
|
y |
|
z |
|
w |
|
data |
a data.frame |
vnames.x |
a vector of character strings with labels for the levels of x |
vnames.y |
a vector of character strings with labels for the levels of y |
vnames.z |
a vector of character strings with labels for the levels of z |
btext |
|
cutz |
logical asking whether to use z variable to split bars or to calculate prozent of positive only. |
zperc |
a single keyword from:
What percentages from z should be calculated? |
b |
width of bars in [0, 1] |
b2 |
depth of 3d bars in [0, 1] |
v |
the x-value(s) for vertical line(s). |
h |
the y-value(s) for horizontal line(s). |
gradient |
logical asking whether to draw a color gradient |
xlab |
a title for the x axis |
ylab |
a title for the y axis |
main |
an overall title for the plot |
ylim |
the y limits (y1, y2) of the plot |
yticks |
the number of ticks on the y axis |
col |
color for the bars representing levels of y |
tcol |
color of the text in whole plot |
bgcol |
the background color for plot dekoration |
lcol |
colors for the lines to shading bars, a vector is possible |
alpha |
a parameter in [0, 1] for semi-transparency of bars |
beside |
logical asking whether to draw bars beside or on top |
legendon |
a single keyword from:
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. |
wall |
a number between 0 and 6 for selection the dekoration style of the plot. |
lhoriz |
logical asking whether to draw legend horizontal |
prozent |
logical asking whether to draw percents on bars |
ploc |
Position of percents
|
form |
a single keyword from:
|
border |
logical asking whether to draw borders os bars |
density |
first density for shading lines, in lines per inch. |
angle |
first angle (in degrees) for the shading lines. |
density2 |
second density for shading lines, in lines per inch. |
angle2 |
second angle (in degrees) for the shading lines. |
fill |
fill color for bars if used density, because the col parameter will be used for color of the shading lines. |
lwd |
width for shading lines |
lty |
linetype for shading lines |
blwd |
width for bar-borders |
blty |
linetype for bar-borders |
See Also
Examples
x<-rbinom(1000, 1, 0.75)
y<-rbinom(1000, 1, 0.30)
z<-rbinom(1000, 1, 0.50)
w<-abs(rnorm(1000))
bar.plot.wtd(x,y,z, w)
bar.plot.wtd(x,y,z, w, wall=4, form='c', main='Bar-Plot')