spaces | R Documentation |
These functions create strings of spaces, pad strings with space, trim edge spaces, and squeeze out unnecessary spaces.
spaces(n)
pad(..., n = 0, s = "r", p = " ")
sqz(...)
trm(...)
n |
A complete positive whole-number scalar indicating the number of spaces or the number of pad characters. |
... |
An arbitrary number of atomic arguments to be processed. |
s |
A complete onechar scalar indicating side(s) to pad: |
p |
A complete onechar scalar containing a single character used to pad strings. |
spaces | Creates a character scalar of n spaces. |
pad | Pads strings with leading, trailing white space using stringr::str_pad . |
sqz | Trims leading, trailing, and extra internal white space using stringr::str_squish . |
trm | Trims leading and trailing white space using stringr::str_trim . |
A character scalar
spaces
A character object
pad, trm, sqz
Other strings:
blank()
,
chn()
,
delim()
,
fsub()
,
gr
,
ipat()
,
makestr()
,
markdown_help()
,
maxnch()
,
ox()
,
ox_vals()
,
pgrid_help()
,
revstr()
,
ss_help()
,
tocase()
,
weave()
Other chars:
chn()
,
maxnch()
,
revstr()
,
ss_help()
spaces(0)
spaces(4)
pad(0:9, n = 3)
pad(0:9, n = 3, s = "r")
pad(0:9, n = 3, s = "l")
pad(0:9, n = 3, s = "b")
pad(0:9, n = 3, s = "b", p = "*")
trm(c("a ", "b", "c", " ", "d ", ""))
sqz(c("a ", "b", "c", " ", "d ", ""))
sqz(trm(c("a ", "b", "c", " ", "d ", "")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.