Learn R Programming

listless (version 0.0-2)

list_str: Summarise the structure of a list

Description

Summarise the structure of a list, in a tidy data frame.

Usage

list_str(l, name_variables = "names", stringsAsFactors = getOption("stringsAsFactors"))

Arguments

l
A variable, probably a list.
name_variables
A string. What should the columns formed from the names of l be called?
stringsAsFactors
Should character columns be converted to factors?

Value

data.frame.

See Also

str, list_to_data.frame

Examples

Run this code
l <- list(
  a = 1,
  b = matrix(1:6, 2),
  c = list(
    ca = y ~ x,
    list(cba = median, cbb = quote(1 + 1), cbc = expression(1 + 1)),
    cc = list(cca = as.name("xyz"))
  ),
  d = array(1:24, 2:4)
)
list_str(l)

Run the code above in your browser using DataLab