Skip to contents

Align text on center text (default is decimal)

Usage

align_chr(
  x,
  accuracy = NULL,
  trim_leading_zeros = FALSE,
  add_plusses = FALSE,
  padding_character = " ",
  center = ".",
  format_integers = FALSE,
  side = c("both", "left", "right"),
  NA_value = "",
  ...
)

Arguments

x

vector (numeric or character)

accuracy

number to round to. If NULL, the current default accuracy set with apa7_defaults() will be used.

trim_leading_zeros

if TRUE (default), trims leading zeros, otherwise keeps them

add_plusses

if TRUE (default), adds a plus to positive numbers

padding_character

character to use for padding, default is   (figure space)

center

text on which to align text. Center on decimal by default, but can be any text.

format_integers

If TRUE, integers will be formatted with digits

side

side on which to make text of equal width

NA_value

value to replace NA

...

additional arguments passed to signs::signs()

Value

character vector

Examples

align_chr(c(1, 10, 100))
#> [1] "  1" " 10" "100"