View source: R/S03_Utilities.R
align_strings | R Documentation |
Function that pads strings to be the same length, with padding applied either to the left or right-hand side.
align_strings(strings, left = TRUE)
strings |
A character vector. |
left |
Logical; if |
A character vector.
# Strings of unequal length
x <- c( "A", "BB", "CCC" )
# Left-aligned
s <- align_strings( x )
message( paste0( '|', s, '|\n' ) )
# Right-aligned
s <- align_strings( x, FALSE )
message( paste0( '|', s, '|\n' ) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.