Learn R Programming

pkgdown (version 2.1.2)

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-math-examples, test-output-styles, test-params, test-sexpr-title, test-tables, test-verbatim

Examples

Run this code
# \dontrun{} --------------------------------------------------------
# always shown; never run

x <- 1
if (FALSE) x <- 2
if (FALSE) {
  x <- 3
  x <- 4
}
x # should be 1

# \donttest{} -------------------------------------------------------
# only multiline are shown; always run

x <- 1
x <- 2
# \donttest{
  x <- 3
  x <- 4
# }
x # should be 4

# \testonly{} -----------------------------------------------------
# never shown, never run

x <- 1
x <- 2
# \testonly{
  x <- 3
  x <- 4
# }
x # should be 1

# \dontshow{} -------------------------------------------------------
# never shown, always run

x <- 1
x <- 2
# \dontshow{
  x <- 3
  x <- 4
# }
x # should be 4

# @examplesIf ------------------------------------------------------
# If FALSE, wrapped in if; if TRUE, not seen

x <- 1

if (FALSE) {
x <- 2
}
x <- 3
x # should be 3

Run the code above in your browser using DataLab