dotchart2
From Hmisc v3.0-10
by Charles Dupont
Enhanced Dot Chart
dotchart2
is an enhanced version of the dotchart
function
with several new options.
- Keywords
- hplot
Usage
dotchart2(data, labels, groups, gdata, horizontal=TRUE, pch=16,
xlab='', ylab='', auxdata, auxgdata=NULL, auxtitle,
lty=if(.R.) 1 else 2, lines=TRUE, dotsize = .8,
cex = par("cex"), cex.labels = cex,
cex.group.labels = cex.labels*1.25, sort.=TRUE,
add=FALSE, dotfont=par('font'), groupfont=if(under.unix)5 else 1,
reset.par=add, xaxis=TRUE, width.factor=if(.R.)1.5 else 1,
lcolor=if(.R.)'gray' else par('col'), ...)
Arguments
- data
- a numeric vector whose values are shown on the x-axis
- labels
- a vector of labels for each point, corresponding to
x
. If omitted,names(data)
are used, and if there are nonames
, integers prefixed by"#"
are used. - groups
- an optional categorical variable indicating how
data
values are grouped - gdata
- data values for groups, typically summaries such as group medians
- horizontal
- set to
FALSE
to make the chart vertical instead of the default - pch
- default character number or value for plotting dots in dot charts. The default is 16.
- xlab
- x-axis title
- ylab
- y-axis title
- auxdata
- a vector of auxiliary data given to
dotchart2
, of the same length as the first (data
) argument. If present, this vector of values will be printed outside the right margin of the dot chart. Usuallyauxdata
repres - auxgdata
- similar to
auxdata
but corresponding to thegdata
argument. These usually represent overall sample sizes for each group of lines. - auxtitle
- if
auxdata
is given,auxtitle
specifies a column heading for the extra printed data in the chart, e.g.,"N"
- lty
- line type for horizontal lines. Default is 1 for R, 2 for S-Plus
- lines
- set to
FALSE
to suppress drawing of reference lines - dotsize
cex
value for drawing dots. Default is 0.8. Note that the originaldotchart
function used a default of 1.2.- cex
- see
par
- cex.labels
cex
parameter that applies only to the line labels for the dot chartcex
parameter for major grouping labels fordotchart2
. Defaults tocex
.- cex.group.labels
- value of
cex
corresponding togdata
- sort.
- set to
FALSE
to keepdotchart2
from sorting the input data, i.e., it will assume that the data are already properly arranged. This is especially useful when you are usinggdata
andgroups
and you wan - add
- set to
TRUE
to add to an existing plot - dotfont
- font number of plotting dots. Default is one. Use
-1
to use "outline" fonts. For example,pch=183, dotfont=-1
plots an open circle for UNIX on postscript.pch=1
makes an open octagon under Windows. - groupfont
- font number to use in drawing
group
labels fordotchart2
. Default is5
for UNIX, which is usually Helvetica bold. For Microsoft Windows, the default is1
. The font number corresponding to some bold - reset.par
- set to
FALSE
to causedotchart2
to not reset thepar
parameters when finished. This is useful whenadd=TRUE
is about to be used in another call. The default is to reset thepar
paramete - xaxis
- set to
FALSE
to suppress drawing x-axis - width.factor
- When the calculated left margin turns out to be faulty, specify a
factor by which to multiple the left margin as
width.factor
to get the appropriate space for labels on horizonal charts. - lcolor
- color for horizontal reference lines. Default is
"gray"
for R,par("col")
for S-Plus. - ...
- arguments passed to
plot.default
Side Effects
dotchart
will leave par
altered if reset.par=FALSE
.
See Also
Community examples
Looks like there are no examples yet.