
latexDotchart
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.
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', ...)
x
. If omitted, names(data)
are used, and if there are
no names
, integers prefixed by "#"
are used.data
values are groupeddata
) argument. If present, this
vector of values will be printed outside the right margin of the dot
chart. Usually auxdata
represents cell sizes.
auxdata
but corresponding to the gdata
argument. These usually represent overall sample sizes for each
group of lines.auxdata
is given, auxtitle
specifies a column
heading for the extra printed data in the chart, e.g., "N"
auxdata
etc.FALSE
to suppress drawing of reference
lines'normalsize'
, 'small'
, 'large'
, smaller[2]
.groups
TRUE
to use typewriter monospaced font
for labelsFALSE
to keep latexDotchart
from sorting the input
data, i.e., it will assume that the data are already properly
arranged. This is especially useful when you are using gdata
and groups
and you want to control the
order that groups appear on the chart (from top to bottom).FALSE
to suppress drawing x-axis"gray"
dotchart3
## Not run:
# z <- latexDotchart(c(.1,.2), c('a','bbAAb'), xlab='This Label',
# auxdata=c(.1,.2), auxtitle='Zcriteria')
# f <- '/tmp/t.tex'
# cat('\documentclass{article}\n\usepackage{epic,color}\n\begin{document}\n', file=f)
# cat(z, sep='\n', file=f, append=TRUE)
# cat('\end{document}\n', file=f, append=TRUE)
#
# set.seed(135)
# maj <- factor(c(rep('North',13),rep('South',13)))
# g <- paste('Category',rep(letters[1:13],2))
# n <- sample(1:15000, 26, replace=TRUE)
# y1 <- runif(26)
# y2 <- pmax(0, y1 - runif(26, 0, .1))
# z <- latexDotchart(y1, g, groups=maj, auxdata=n, auxtitle='n', xlab='Y',
# size.group.labels='large', ttlabels=TRUE)
# f <- '/tmp/t2.tex'
# cat('\documentclass{article}\n\usepackage{epic,color}\n\begin{document}\n\framebox{', file=f)
# cat(z, sep='\n', file=f, append=TRUE)
# cat('}\end{document}\n', file=f, append=TRUE)
# ## End(Not run)
Run the code above in your browser using DataLab