Learn R Programming

xfun (version 0.50)

tabset: Represent a (recursive) list with (nested) tabsets

Description

The tab titles are names of list members, and the tab content contains the values of list members. If a list member is also a list, it will be represented recursively with a child tabset.

Usage

tabset(x, value = str)

Value

A character vector of Markdown that can be rendered to HTML with litedown::mark().

Arguments

x

A list.

value

A function to print the value of a list member. By default, str() is used to print the structure of the value. You may also use dput() to output the full value, but it may be slow when the size of the value is too big.

Examples

Run this code
xfun::tabset(iris)
xfun::tabset(iris, dput)
xfun::tabset(iris, print)

# a deeply nested list
plot(1:10)
p = recordPlot()
xfun::tabset(p)

Run the code above in your browser using DataLab