Last chance! 50% off unlimited learning
Sale ends in
StrAlign(x, sep = " ", ...)
sep = "\\^"
and right alignment by "\\$"
.StrPos
to regexpr
and can for example be used to set fix = TRUE
for using plain text of the required pattern.StrTrim
, Format
# align on (the first occuring) B
x <- c("ABCDMNB", "CDGHEBK", "BCI")
cbind(StrAlign(x, sep="B"))
# align to decimal point
z <- c("6.0", "6.00 ", "45.12 ")
cbind(StrAlign(z, sep="."))
# right align, the width will be the max number of characters in x
StrAlign(x, sep="\\$")
Run the code above in your browser using DataLab