| repr_ls | R Documentation |
Works exactly like printls, but instead of printing to console with cat, it outputs a single string, formatted using mformat, so that cat(repr_ls(x)) looks identical to printls(x) for any list x
repr_ls(
x,
prefix = "",
pad = 2L,
item_format = bold,
maxlength = 4L,
center_title = TRUE,
title = NULL,
title_newline = TRUE,
newline_pre = FALSE,
format_fn_rhs = ddSci,
print_class = TRUE,
abbrev_class_n = 3L,
print_df = FALSE,
print_S4 = FALSE,
limit = 12L,
output_type = c("ansi", "html", "plain")
)
x |
list or object that will be converted to a list. |
prefix |
Character: Optional prefix for names. |
pad |
Integer: Pad output with this many spaces. |
item_format |
Formatting function for items. |
maxlength |
Integer: Maximum length of items to show using |
center_title |
Logical: If TRUE, autopad title for centering, if present. |
title |
Character: Title to print before list. |
title_newline |
Logical: If TRUE, print title on new line. |
newline_pre |
Logical: If TRUE, print newline before list. |
format_fn_rhs |
Formatting function for right-hand side of items. |
print_class |
Logical: If TRUE, print abbreviated class of object. |
abbrev_class_n |
Integer: Number of characters to abbreviate class names to. |
print_df |
Logical: If TRUE, print data frame contents, otherwise print n rows and columns. |
print_S4 |
Logical: If TRUE, print S4 object contents, otherwise print class name. |
limit |
Integer: Maximum number of items to show. |
output_type |
Character: Output type for mformat ("ansi", "html", "plain"). |
Exported as internal function for use by other rtemis packages.
Character: Formatted string that can be printed with cat()
EDG
x <- list(
a = 1:10,
b = "Hello",
c = list(
d = 1,
e = 2
)
)
cat(repr_ls(x, title = "A List"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.