View source: R/utils_justify.R
justify.proportional | R Documentation |
justify.proportional is a variation on the justify function that, instead of using a single character (e.g. " ") to pad strings to achieve justification, will use characters from other strings in the vector. This is useful when the output font is not monospaced, and may not even use tabular numbers (i.e. the number widths may be proportional). Usually, the decimal character is not the same width as the numbers, and this can create problems when using extra characters to justify a column of numbers. The function returns a list of two vectors: a left-padding vector of string and right-padding vector of strings. Concatenate these with the original vector of strings to achieve the desired justification.
justify.proportional( input_vec, justify_mode = "d", decimal = ".", tabular_numbers = TRUE, tabular_char = "0", unicode_spaces = FALSE, monospace = FALSE )
input_vec |
Input vector. Coerced to character. |
justify_mode |
Mode to use for justifying a vector of values. Can be "l" (left), "c" (center), "r" (right), or "d" (decimal). |
decimal |
Character to justify around when justify_mode = "decimal" |
tabular_numbers |
When By specifying |
tabular_char |
See |
unicode_spaces |
Override to replace paddings with unicode spaces, using punctuation space (U+2008) punctuation and figure space (U+2007) otherwise. Assumes all digits are the same width and supercedes tabular numbers if TRUE. |
monospace |
Override to assume all characters are monospaced. Supercedes other options if TRUE. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.