Learn R Programming

nuggets (version 2.0.1)

format_condition: Format a vector of predicates into a condition string

Description

Convert a character vector of predicate names into a standardized string representation of a condition. Predicates are concatenated with commas and enclosed in curly braces. This formatting ensures consistency when storing or comparing conditions in other functions.

Usage

format_condition(condition)

Value

A character scalar containing the formatted condition string.

Arguments

condition

A character vector of predicate names to be formatted. If NULL or of length zero, the result is "{}", representing an empty condition that is always true.

Author

Michal Burda

See Also

parse_condition(), fire()

Examples

Run this code
format_condition(NULL)
format_condition(character(0))
format_condition(c("a", "b", "c"))

Run the code above in your browser using DataLab