This function returns a message indicating whether an assertion test has passed or failed. An "assertion collection" from the checkmate package must be provided. The message can be returned as an error or a warning. For some assertions, only warnings are allowed, as an error would stop the script from running. This is done for the following assertions: percentage missing values, duplicates, subset, and set_equal.

return_assertions_message(
  collection,
  collection_name,
  fail = "stop",
  silent = FALSE,
  output_map = NULL
)

Arguments

collection

An object with the class "AssertCollection".

collection_name

The name of the collection. This name is mentioned in the messages.

fail

"stop" or "warning". If the assertions fail, an error is returned and the script output is stopped. If "warning", only a warning is returned.

silent

If FALSE (default), the success message is printed in the console. If TRUE, it is not shown.

output_map

A map, like 1. Read data, where the file is stored.

Value

The message indicating whether the assertion test has passed or failed.