Learn R Programming

texreg (version 1.39.4)

compute.width: 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 = ")")

Value

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

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).

Author

Philip Leifeld

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.

See Also

texreg