extend_condition: Extend a condition string by adding a new condition based on...

View source: R/derive_vars_cat.R

extend_conditionR Documentation

Extend a condition string by adding a new condition based on a variable and its value

Description

This internal helper function extends a condition string by appending a new condition that checks if a variable equals a specific value.

Usage

extend_condition(cond, var, is)

Arguments

cond

A character string representing an existing condition.

var

A character string representing the name of the variable to check.

is

A character string representing the value the variable should be equal to.

Value

A character string representing the extended condition.

Examples

# Extend an existing condition to include a check for 'AGE == "30"'
admiral:::extend_condition("SEX == 'M'", "AGE", "30")

admiral documentation built on April 4, 2025, 4:39 a.m.