powered by
Align an ANSI colored string
col_align( text, width = getOption("width"), align = c("left", "center", "right"), type = "width" )
The aligned character vector.
The character vector to align.
Width of the field to align in.
Whether to align "left", "center" or "right".
"left"
"center"
"right"
Passed on to col_nchar() and there to nchar()
col_nchar()
nchar()
Other ANSI string operations: col_nchar(), col_strsplit(), col_substr(), col_substring()
col_strsplit()
col_substr()
col_substring()
col_align(red("foobar"), 20, "left") col_align(red("foobar"), 20, "center") col_align(red("foobar"), 20, "right")
Run the code above in your browser using DataLab