Learn R Programming

pkgdown (version 2.0.8)

test-dont: Test case: don't

Description

Test case: don't

Arguments

See Also

Other tests: index, test-crayon, test-figures, test-links, test-lists, test-long-lines, test-output-styles, test-params, test-sexpr-title, test-verbatim

Examples

Run this code
if (FALSE) {
  abort("This is an error!")
}

# Inline \donttest is silently ommitted
message("Hi!")

# Block \donttest indicated with comments
# \donttest{
# This is a comment
1 + 3
# }

# And works even when not at the top level
if (TRUE) {
  # \donttest{
  1 + 2
  # }
}

answer <- 1
# \dontshow{
answer <- 42
# }
answer # should be 42

# To hide the \dontshow part, for conditional examples
if (FALSE) {
answer <- 43
}
answer # should be still 42

# But this one runs, and the condition is hidden
answer <- 43
answer

Run the code above in your browser using DataLab