powered by
Prints text using cat only when a specified logical condition is TRUE.
cat
TRUE
catif(cond, ...)condition_cat(cond, ...)
condition_cat(cond, ...)
Invisibly returns the value of cond.
cond
Logical value. If TRUE, the text provided in ... is printed using cat; if FALSE, nothing is printed.
...
FALSE
Additional arguments passed to cat.
catif(TRUE, "PDF") # This text is printed catif(FALSE, "Moodle") # Nothing is printed condition_cat(TRUE, "Hello") # Alias works the same way
Run the code above in your browser using DataLab