Open garner-code opened 1 week ago
stopping the code and throwing an error if condition is not met:
if (x != y) { stop("Error: x is not equal to y") }
throwing a warning if condition is not met, but continuing with the code execution:
if (x < 0) { warning("Warning: x is negative, which may lead to unexpected behavior.") }
stopping the code and throwing an error if condition is not met:
if (x != y) { stop("Error: x is not equal to y") }
throwing a warning if condition is not met, but continuing with the code execution:
if (x < 0) { warning("Warning: x is negative, which may lead to unexpected behavior.") }