# raise error if there is a warning
options(warn = 2)

# default: do not raise error in case of warnings
options(warn = 1)