catif: Conditional Cat Output

View source: R/catif.R

catifR Documentation

Conditional Cat Output

Description

Prints text using cat only when a specified logical condition is TRUE.

Usage

catif(cond, ...)

condition_cat(cond, ...)

Arguments

cond

Logical value. If TRUE, the text provided in ... is printed using cat; if FALSE, nothing is printed.

...

Additional arguments passed to cat.

Value

Invisibly returns the value of cond.

Examples

catif(TRUE, "PDF")          # This text is printed
catif(FALSE, "Moodle")      # Nothing is printed
condition_cat(TRUE, "Hello") # Alias works the same way

exams.forge documentation built on Aug. 21, 2025, 5:41 p.m.