compute.width: Compute maximum column width left and right of a decimal...

View source: R/texreg.R

compute.widthR Documentation

Compute maximum column width left and right of a decimal separator

Description

Compute maximum column width left and right of a decimal separator.

Usage

compute.width(v, left = TRUE, single.row = FALSE, bracket = ")")

Arguments

v

A character vector representing a column in a regression table.

left

Should the width left of the separator/bracket be calculated? If FALSE, the width right of the separator/bracket is computed.

single.row

Was the single.row argument used to construct the regression table? I.e., are both the coefficient and uncertainty measure (SE or CI) in the same rows of the matrix?

bracket

The separator symbol to match. These can be closing parentheses (in the case of standard errors when single.row is switched on), closing square brackets (in the case of confidence intervals), or dots (in the case of single.row = FALSE, for decimal alignment at the actual decimal separator).

Details

This function takes a vector of character objects with coefficients, usually a column of a regression table, and computes the maximal width left or right of the decimal separator or bracket at which the cells are aligned vertically. This is useful in the context of the texreg function when the dcolumn or siunitx arguments are used for vertical decimal point alignment.

Value

A number indicating the maximal width left or right of the separator.

Author(s)

Philip Leifeld

See Also

texreg


texreg documentation built on Sept. 11, 2024, 6:41 p.m.