inst/tests/latexpng.r

# See tex.stackexchange.com/questions/11866
require(Hmisc)
getHdata(pbc)
s <- summaryM(bili + albumin + stage + protime + sex +
              age + spiders ~ drug, data=pbc)
f <- '/tmp/z.tex'
cat('\\documentclass[convert={density=600,outext=.png}]{standalone}\n\\begin{document}\n', file=f)
w <- latex(s, npct='both', center='none', table.env=FALSE, insert.bottom = FALSE, file=f, append=TRUE)
cat('\\end{document}\n', file=f, append=TRUE)

system('cd /tmp; latex -shell-escape z; display /tmp/z.png')

Try the Hmisc package in your browser

Any scripts or data that you put into this service are public.

Hmisc documentation built on Sept. 12, 2023, 5:06 p.m.