nested_list: Output a nested list in RMarkdown list format

Description Usage Arguments Value Examples

View source: R/nested_list.R

Description

Output a nested list in RMarkdown list format

Usage

1
nested_list(x, pre = "")

Arguments

x

The list

pre

Test to prefix to each line (e.g., if you want all lines indented 4 spaces to start, use " ")

Value

A character string

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
x <- list(
  a = list(a1 = "Named", a2 = "List"),
  b = list("Unnamed", "List"),
  c = c(c1 = "Named", c2 = "Vector"),
  d = c("Unnamed", "Vector"),
  e = list(e1 = list("A", "B", "C"),
           e2 = list(a = "A", b = "B"),
           e3 = c("A", "B", "C"),
           e4 = 100),
  f = "not a list or vector"
)
nested_list(x)

debruine/pdsbuilder documentation built on July 8, 2020, 9:40 p.m.