decimal_align: Decimal alignment

View source: R/tostring.R

decimal_alignR Documentation

Decimal alignment

Description

Aligning decimal values of string matrix. Allowed alignments are: dec_left, dec_right, and decimal.

Usage

decimal_align(string_mat, align_mat)

Arguments

string_mat

(⁠character matrix⁠)
"string" matrix component of MatrixPrintForm object.

align_mat

(⁠character matrix⁠)
"aligns" matrix component of MatrixPrintForm object. Should contain either dec_left, dec_right, or decimal for values to be decimal aligned.

Details

Left and right decimal alignment (dec_left and dec_right) differ from center decimal alignment (decimal) only when there is padding present. This may occur if column widths are set wider via parameters widths in toString or colwidths in ⁠paginate_*⁠. More commonly, it also occurs when column names are wider. Cell wrapping is not supported when decimal alignment is used.

Value

A processed string matrix of class MatrixPrintForm with decimal-aligned values.

See Also

toString(), MatrixPrintForm()

Examples

dfmf <- basic_matrix_form(mtcars[1:5, ])
aligns <- mf_aligns(dfmf)
aligns[, -c(1)] <- "dec_left"
decimal_align(mf_strings(dfmf), aligns)


formatters documentation built on Sept. 13, 2024, 1:10 a.m.