Learn R Programming

crmPack (version 2.0.0)

check_format: Check that an argument is a valid format specification

Description

[Stable]

Usage

check_format(x, len = NULL, min.len = NULL, max.len = NULL)

assert_format( x, len = NULL, min.len = NULL, max.len = NULL, .var.name = checkmate::vname(x), add = NULL )

test_format(x, len = NULL, min.len = NULL, max.len = NULL)

expect_format( x, len = NULL, min.len = NULL, max.len = NULL, info = NULL, label = vname(x) )

Value

TRUE if successful, otherwise a string with the error message.

Arguments

x

[any]
Object to check.

len

[integer(1)]
Exact expected length of x.

min.len

[integer(1)]
Minimal length of x.

max.len

[integer(1)]
Maximal length of x.

.var.name

[character(1)]
Name of the checked object to print in assertions. Defaults to the heuristic implemented in vname.

add

[AssertCollection]
Collection to store assertion messages. See AssertCollection.

info

[character(1)]
Extra information to be included in the message for the testthat reporter. See expect_that.

label

[character(1)]
Name of the checked object to print in messages. Defaults to the heuristic implemented in vname.

See Also

assertions for more details.

Examples

Run this code
check_format("%5.2f")

Run the code above in your browser using DataLab