2023-09-05 23:10:45 +02:00
|
|
|
% Generated by roxygen2: do not edit by hand
|
|
|
|
% Please edit documentation in R/add_padding.R
|
|
|
|
\name{add_padding}
|
|
|
|
\alias{add_padding}
|
|
|
|
\title{Add padding to string}
|
|
|
|
\usage{
|
2024-02-07 20:56:05 +01:00
|
|
|
add_padding(
|
|
|
|
d,
|
|
|
|
length = NULL,
|
|
|
|
after = FALSE,
|
|
|
|
pad = "0",
|
|
|
|
lead = NULL,
|
|
|
|
tail = NULL
|
|
|
|
)
|
2023-09-05 23:10:45 +02:00
|
|
|
}
|
|
|
|
\arguments{
|
|
|
|
\item{d}{vector of strings or numbers}
|
|
|
|
|
|
|
|
\item{length}{final string length}
|
|
|
|
|
|
|
|
\item{after}{if padding should be added after as opposed to default before}
|
|
|
|
|
|
|
|
\item{pad}{padding string of length 1}
|
2024-02-07 20:56:05 +01:00
|
|
|
|
|
|
|
\item{lead}{leading string for all. Number or character vector. Cycled.}
|
|
|
|
|
|
|
|
\item{tail}{tailing string for all. Number or character vector. Cycled.}
|
2023-09-05 23:10:45 +02:00
|
|
|
}
|
|
|
|
\value{
|
|
|
|
vector or character strings of same length.
|
|
|
|
}
|
|
|
|
\description{
|
|
|
|
Add padding to string
|
|
|
|
}
|
|
|
|
\examples{
|
2024-02-07 20:56:05 +01:00
|
|
|
add_padding(sample(1:200,5),tail="AA",lead=c(2,3,"e"))
|
2023-09-05 23:10:45 +02:00
|
|
|
}
|