# NOT RUN {
stop("This is an error!", call. = FALSE)
# }
# NOT RUN {
# Inline \donttest is silently ommitted
# }
# NOT RUN {
message("Hi!")
# }
# NOT RUN {
# Block \donttest indicated with comments
# }
# NOT RUN {
# This is a comment
1 + 3
# }
# NOT RUN {
# And works even when not at the top level
if (TRUE) {
# }
# NOT RUN {
1 + 2
# }
# NOT RUN {
}
answer <- 1
# }
# NOT RUN {
answer # should be 42
# }
Run the code above in your browser using DataLab