Learn R Programming

stRoke (version 25.9.2)

add_padding: MOVED Add padding to string

Description

MOVED Add padding to string

Usage

add_padding(
  d,
  length = NULL,
  after = FALSE,
  pad = "0",
  lead = NULL,
  tail = NULL
)

Value

vector or character strings of same length.

Arguments

d

vector of strings or numbers

length

final string length

after

if padding should be added after as opposed to default before

pad

padding string of length 1

lead

leading string for all. Number or character vector. Cycled.

tail

tailing string for all. Number or character vector. Cycled.

Examples

Run this code
add_padding(sample(1:200,5),tail="AA",lead=c(2,3,"e"))

Run the code above in your browser using DataLab