Compute maximum column width left and right of a decimal separator.
compute.width(v, left = TRUE, single.row = FALSE, bracket = ")")A number indicating the maximal width left or right of the separator.
A character vector representing a column in a regression
table.
Should the width left of the separator/bracket be calculated? If
FALSE, the width right of the separator/bracket is computed.
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?
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).
Philip Leifeld
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.
texreg