find_first_noncall: Create a recursive function to find the first non-call object

View source: R/utils.R

find_first_noncallR Documentation

Create a recursive function to find the first non-call object

Description

This function iteratively dives into the provided list (R expression), until it finds an object that is not a function call or a complex command. The [[2]] is used with the argument 2, because in the list representation of function calls in R, the actual function is the first element, and its arguments are the subsequent elements. So object 2 generally refers to the first argument of the function call.

Usage

find_first_noncall(object)

Arguments

object

A list representing an R expression.

Value

The first non-call object found in the list representation of an R expression.


data.validator documentation built on May 29, 2024, 6:37 a.m.