max_pad | R Documentation |
Vectorised over string, width and pad. Pad to the maximum width in a string.
max_pad(string, width = 0, side = c("left", "right", "both"), pad = " ")
string |
A character vector. |
width |
Minimum width of padded strings. |
side |
Side on which padding character is added (left, right or both). |
pad |
Single padding character (default is a space). |
A character vector.
x <- c("abc", "123456", "defg")
max_pad(x)
max_pad(x, side = "right")
max_pad(x, pad = "0")
max_pad(x, side = "right", pad = "0")
max_pad(x, side = "both", pad = "0")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.