format_vector | R Documentation |
Format atomic vectors, lists, and pairlists.
format_vector(
x = vector(),
label = NULL,
level = 0L,
indent = 1L,
fill_names = FALSE,
null = "<null>",
empty = "<empty>",
validate = TRUE
)
x |
A vector of any atomic mode, a list, or a pairlist. It can be empty and it can contain NA values. |
label |
A |
level |
A non-NA integer value. The current depth, or current nesting level to use for indentation purposes. |
indent |
A non-NA integer value. The number of single space(s) to use
for each |
fill_names |
A non-NA logical value. Should |
null |
A non-empty and non-NA character string. The value to use to
represent |
empty |
A non-empty and non-NA character string. The value to use to
represent empty vectors, excluding |
validate |
A non-NA logical value. Should the arguments be validated before being used? This argument should be left as is. |
format_vector()
is an alternative to utils::str()
that exposes a much
simpler generic formatting interface and yields terser outputs of name/value
pairs. Indentation is used for nested values.
format_vector()
does not attempt to cover all R objects like
utils::str()
. Instead, it (merely) focuses on efficiently handling the
types used by transltr
. It is the low-level workhorse function of
format.Translator()
, format.Text()
, and format.Location()
.
A character vector, possibly trimmed by str_trim()
.
str_trim()
Other utility functions:
stops()
,
str_to()
,
vapply_1l()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.