Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

call_tree

Display a call (or expression) as a tree.


Description

call_tree takes a quoted expression. ast does the quoting for you.

Usage

call_tree(x, width = getOption("width"))

ast(x)

Arguments

x

quoted call, list of calls, or expression to display

width

displays width, defaults to current width as reported by getOption("width")

Examples

call_tree(quote(f(x, 1, g(), h(i()))))
call_tree(quote(if (TRUE) 3 else 4))
call_tree(expression(1, 2, 3))

ast(f(x, 1, g(), h(i())))
ast(if (TRUE) 3 else 4)
ast(function(a = 1, b = 2) {a + b})
ast(f()()())

pryr

Tools for Computing on the Language

v0.1.4
GPL-2
Authors
Hadley Wickham [aut, cre], R Core team [ctb] (Some code extracted from base R)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.