draw a tornado plot, it could be a population pyramid
tornado.ade(x, group=NULL, group2=NULL, data=NULL, vnames=NULL, gnames=NULL,
gnames2=NULL, breaks=6, density=NULL, angle=NULL,
xlab=NULL, glab=NULL, main='', legendon='topright', xticks=NULL,
col=NULL, tcol=NULL, bgcol=NULL, lcol=NULL, alpha=NULL,
r=0.05, lwd=1, lty=2, wall=0, v=NULL, h=NULL)
a numeric vector
a sigle factor
a string with the name of the variable in the data.frame
a formula x~group+group2
a table or matrix
a list of tables
a factor to separate the plot in two halves
a string with the name of the factor in the data.frame
nothing if x is a formula, table or list
a factor to separate the plot in several groups
a string with the name of the factor in the data.frame
nothing if x is a formula, table or list
a data.frame
a vector of character strings with the names of groups in tornado eye
a vector of character strings with the names of both groups
a vector of character strings with the names of groups in the legend
a single number giving the number of cells to separate x, works only if x is a numeric vector
the vector of density of shading bars in each group
the vector of slopes of shading bars, given as an angle in degrees (counter-clockwise).
a title for the x axis
a title for the legend
an overall title for the plot
a single keyword from:
"bottomright"
"bottom"
"bottomleft"
"left"
"topleft"
"top"
"topright"
"right"
"center"
This places the legend on the inside of the plot frame at the given location.
the number of ticks on the x axis
colors for each group
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, only used if h or v is given
a parameter in [0, 1] for semi-transparency of bars
the width of empty edge for the legend if it overlap the bars
the line width
the line type, a vector of types is possible
a number between 0 and 6 for selection the dekoration style of the plot.
the x-value(s) for vertical line(s).
the y-value(s) for horizontal line(s).
tab1<-cbind(rpois(20, 20),rpois(20, 20))
tab2<-cbind(rpois(20, 15),rpois(20, 15))
tab3<-cbind(rpois(20, 10),rpois(20, 10))
tornado.ade(list(tab1, tab2, tab3), gnames=c('Men','Women'), xlab='number')
Run the code above in your browser using DataLab