Learn R Programming

Hmisc (version 5.3-0)

latexTherm: Create LaTeX Thermometers and Colored Needles

Description

latexTherm creates a LaTeX picture environment for drawing a series of thermometers whose heights depict the values of a variable y assumed to be scaled from 0 to 1. This is useful for showing fractions of sample analyzed in any table or plot, intended for a legend. For example, four thermometers might be used to depict the fraction of enrolled patients included in the current analysis, the fraction randomized, the fraction of patients randomized to treatment A being analyzed, and the fraction randomized to B being analyzed. The picture is placed inside a LaTeX macro definition for macro variable named name, to be invoked by the user later in the LaTeX file using name preceeded by a backslash.

If y has an attribute "table", it is assumed to contain a character string with LaTeX code. This code is used as a tooltip popup for PDF using the LaTeX ocgtools package or using style tooltips. Typically the code will contain a tabular environment. The user must define a LaTeX macro tooltipn that takes two arguments (original object and pop-up object) that does the pop-up.

latexNeedle is similar to latexTherm except that vertical needles are produced and each may have its own color. A grayscale box is placed around the needles and provides the 0-1 y-axis reference. Horizontal grayscale grid lines may be drawn.

pngNeedle is similar to latexNeedle but is for generating small png graphics. The full graphics file name is returned invisibly.

Usage

latexTherm(y, name, w = 0.075, h = 0.15, spacefactor = 1/2, extra = 0.07,
           file = "", append = TRUE)

latexNeedle(y, x=NULL, col='black', href=0.5, name, w=.05, h=.15, extra=0, file = "", append=TRUE)

pngNeedle(y, x=NULL, col='black', href=0.5, lwd=3.5, w=6, h=18, file=tempfile(fileext='.png'))

Arguments