.BG
.FN dotchart
.TL
Draw a Dot Chart
.CS
dotchart(data, labels, groups=NULL,
         gdata=NULL, horizontal=T, pch="o", 
	 lty=2, lines=T, dotsize=1.2)
.AG data
vector of all data values.
.AG labels
optional vector of labels for data values.
If missing, labels are taken from the `names' attribute of `data'
or constructed.
.AG groups
categorical variable used for splitting data vector into groups and
providing group labels.
.AG gdata
optional vector of group data, that is, an overall value for each group.
This could be a sum or an average, for example.
.AG horizontal
should data values be on horizontal or vertical axis?
.AG pch
optional character to be used as plot character.
.AG lty
line type used in drawing the dotted line.
.AG lines
if TRUE, the dotted line should be drawn.
.AG dotsize
the size of the plot character `pch' relative to the standard
character size (controlled by graphical parameter `cex').
.GR
.EX
perc.data <- c(5.4, 3.1, 3.5, 5.7, 8.6, 25.0, 20.4,
	26.0, 22.0, 36.3, 34.1, 28.0, 14.4, 11.4, 4.5)
percent <- matrix(perc.data,ncol=3,byrow=T)
community <- c("Old Suburb","Coast County","New Suburb") 
service <- c("Child Care","Health Services",
	"Community Centers","Family & Youth", "Other")
com <- code(col(percent),label=community)
serv <- code(row(percent),label=service)

dotchart(percent,labels=levels(com)[com],group=serv)

dotchart(percent,labels=levels(serv)[serv],group=com,
    horiz=F)

# now plot the same thing with the median percent for each service
# the example plot was produced by:

gmed <- tapply(percent,index(com),median)
dotchart(percent,labels=levels(serv)[serv],group=com,
    gdata=gmed)
.PI
.KW hplot
.WR
