bi.bars {psych}R Documentation

Draw pairs of bargraphs based on two groups

Description

When showing e.g., age or education distributions for two groups, it is convenient to plot them back to back. bi.bars will do so.

Usage

bi.bars(x,grp,horiz,color,...) 

Arguments

x

The data to be drawn

grp

a grouping variable.

horiz

horizontal (default) or vertical bars

color

colors for the two groups – defaults to blue and red

...

Further parameters to pass to the graphing program

Details

A trivial, if useful, function to draw back to back histograms/barplots. One for each group.

Value

a graphic

Author(s)

William Revelle

Examples

data(bfi)
with(bfi,{bi.bars(age,gender,ylab="Age",main="Age by males and females")
       bi.bars(education,gender,xlab="Education",main="Education by gender",horiz=FALSE)})

[Package psych version 1.4.5 Index]
Part of the Personality Project      Take our Personality Test