tornado.ade {epade}R Documentation

Tornado or population plot

Description

draw a tornado plot, it could be a population pyramid

Usage

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)

Arguments

x
  • 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

group
  • 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

group2
  • 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

data

a data.frame

vnames

a vector of character strings with the names of groups in tornado eye

gnames

a vector of character strings with the names of both groups

gnames2

a vector of character strings with the names of groups in the legend

breaks

a single number giving the number of cells to separate x, works only if x is a numeric vector

density

the vector of density of shading bars in each group

angle

the vector of slopes of shading bars, given as an angle in degrees (counter-clockwise).

xlab

a title for the x axis

glab

a title for the legend

main

an overall title for the plot

legendon

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.

xticks

the number of ticks on the x axis

col

colors for each group

tcol

color of the text in whole plot

bgcol

the background color for plot dekoration

lcol

color for the lines in plot, a vector of colors is possible, only used if h or v is given

alpha

a parameter in [0, 1] for semi-transparency of bars

r

the width of empty edge for the legend if it overlap the bars

lwd

the line width

lty

the line type, a vector of types is possible

wall

a number between 0 and 6 for selection the dekoration style of the plot.

v

the x-value(s) for vertical line(s).

h

the y-value(s) for horizontal line(s).

Examples

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')

[Package epade version 0.5.1 Index]