toolExpectTrue: toolExpectTrue

View source: R/toolExpectTrue.R

toolExpectTrueR Documentation

toolExpectTrue

Description

tool function for status reporting. It performs a logical check and returns either a message via toolStatusMessage, that the test was successful or that it failed.

Usage

toolExpectTrue(check, description, level = 0, falseStatus = "note")

Arguments

check

logical check to be run (has to be either TRUE or FALSE)

description

a description of the check

level

as the test result will be linked to a function call, the function needs to know to which call it should be linked. by default (level = 0) the parent function call is being used. Increasing the number by one will let the function go up by one in the call stack, level = -1 will use toolExpectTrue itself as function call.

falseStatus

the type of status that is used when the check fails (typically "note" for a simple message or "warn" for a warning).

Author(s)

Jan Philipp Dietrich

See Also

getMadratMessage, toolExpectLessDiff, toolStatusMessage, toolWriteMadratLog

Examples

toolExpectTrue(is.numeric(1), "data is numeric", level = -1)
getMadratMessage("status")

pik-piam/mstools documentation built on Dec. 8, 2024, 5:29 a.m.