printls: Pretty print list

View source: R/utils_print.R

printlsR Documentation

Pretty print list

Description

Pretty print a list (or data frame) recursively

Usage

printls(
  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
)

Arguments

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 list item names.

maxlength

Integer: Maximum length of items to show using headdot() before truncating with ellipsis.

center_title

Logical: If TRUE, autopad title for centering, if present.

title

Character: Optional 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 values.

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. Use -1 for unlimited.

Details

Data frames in R began life as lists

Value

NULL invisibly

Author(s)

EDG

Examples

printls(list(a = 1:10, b = "Hello", c = list(d = 1, e = 2)), title = "A List")

rtemis.core documentation built on April 22, 2026, 1:11 a.m.