Skip to contents

Call from a setup chunk. Checks the document and/or its bibliography; if the fail policy is triggered it aborts (or warns) the render.

Usage

retraction_knit_check(
  input = NULL,
  bib = NULL,
  on = "flagged",
  action = c("error", "warn"),
  sources = getOption("retraction.sources", "xera"),
  offline = FALSE
)

Arguments

input

Path to the document being knit. Defaults to knitr::current_input() when knitting.

bib

Optional path(s) to bibliography files to check as well.

on

Fail policy states (see fail_policy()): any of "flagged", "possible", "unchecked", "error". Default "flagged".

action

"error" (default; abort the render) or "warn".

sources, offline

Passed to check_file().

Value

Invisibly, the combined retraction_result.

Examples

if (FALSE) { # \dontrun{
retraction::retraction_knit_check(bib = "refs.bib",
                                  on = c("flagged", "unchecked"))
} # }