calls_combine_by: Compose predicates

View source: R/calls_combine_by.R

calls_combine_byR Documentation

Compose predicates

Description

Combines calls with a logical operator.

Usage

calls_combine_by(calls, operator)

Arguments

calls

(list) containing calls (or symbols) to be combined by operator

operator

(character(1)) infix operator to use in predicate composition, e.g. "&"

Details

This function is used to combine logical predicates produced by FilterState objects to build a complete subset expression.

Value

A call where elements of calls are composed with operator or NULL if calls is an empty list.

Examples

# use non-exported function from teal.slice
calls_combine_by <- getFromNamespace("calls_combine_by", "teal.slice")

calls <- list(
  quote(SEX == "F"), # subsetting on factor
  quote(AGE >= 20 & AGE <= 50), # subsetting on range
  quote(!SURV) # subsetting on logical
)
calls_combine_by(calls, "&")


teal.slice documentation built on May 29, 2024, 1:39 a.m.