lang2calls: Separate calls

View source: R/utils.R

lang2callsR Documentation

Separate calls

Description

Converts language object or lists of language objects to list of simple calls.

Usage

lang2calls(x)

Arguments

x

language object or a list of thereof

Value

Given a call, an expression, a list of calls or a list of expressions, returns a list of calls. Symbols and atomic vectors (which may get mixed up in a list) are returned wrapped in list.

Examples

# use non-exported function from teal.code
lang2calls <- getFromNamespace("lang2calls", "teal.code")
expr <- expression(
  i <- iris,
  m <- mtcars
)
lang2calls(expr)

teal.code documentation built on April 4, 2025, 5:16 a.m.