Enhanced Dot Chart for LaTeX Picture Environment with epic
latexDotchart.RdlatexDotchart is a translation of the dotchart3 function
for producing a vector of character strings containing LaTeX picture
environment markup that mimics dotchart3 output. The LaTeX
epic and color packages are required. The add and
horizontal=FALSE options are not available for
latexDotchart, however.
Usage
latexDotchart(data, labels, groups=NULL, gdata=NA,
xlab='', auxdata, auxgdata=NULL, auxtitle,
w=4, h=4, margin,
lines=TRUE, dotsize = .075, size='small', size.labels='small',
size.group.labels='normalsize', ttlabels=FALSE, sort.=TRUE,
xaxis=TRUE, lcolor='gray', ...)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
datavalues are grouped- gdata
data values for groups, typically summaries such as group medians
- xlab
x-axis title
- auxdata
a vector of auxiliary data, 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. Usuallyauxdatarepresents cell sizes.- auxgdata
similar to
auxdatabut corresponding to thegdataargument. These usually represent overall sample sizes for each group of lines.- auxtitle
if
auxdatais given,auxtitlespecifies a column heading for the extra printed data in the chart, e.g.,"N"- w
width of picture in inches
- h
height of picture in inches
- margin
a 4-vector representing, in inches, the margin to the left of the x-axis, below the y-axis, to the right of the x-axis, and above the y-axis. By default these are computed making educated cases about how to accommodate
auxdataetc.- lines
set to
FALSEto suppress drawing of reference lines- dotsize
diameter of filled circles, in inches, for drawing dots
- size
size of text in picture. This and the next two arguments are LaTeX font commands without the opening backslash, e.g.,
'normalsize','small','large',smaller[2].- size.labels
size of labels
- size.group.labels
size of labels corresponding to
groups- ttlabels
set to
TRUEto use typewriter monospaced font for labels- sort.
set to
FALSEto keeplatexDotchartfrom sorting the input data, i.e., it will assume that the data are already properly arranged. This is especially useful when you are usinggdataandgroupsand you want to control the order that groups appear on the chart (from top to bottom).- xaxis
set to
FALSEto suppress drawing x-axis- lcolor
color for horizontal reference lines. Default is
"gray"- ...
ignored
Author
Frank Harrell
Department of Biostatistics
Vanderbilt University
fh@fharrell.com