Use check(), test(), assert(), expect() and need() to validate classed objects from this package.

Check S3 class.

check(x)

test(x)

# S3 method for default
test(x)

expect(x, info = NULL, label = NULL)

# S3 method for default
expect(x, info = NULL, label = paste(class(x), "S3 class"))

assert(x, collection = NULL, var.name = NULL)

# S3 method for default
assert(x, collection = NULL, var.name = paste(class(x)[1], "S3 class"))

need(x, label = NULL)

# S3 method for default
need(x, label = NULL)

Arguments

x

class object created by respective constructor function.

info

[character(1)]
See expect_that

label

[character(1)]
See expect_that

collection

[AssertCollection]
If an AssertCollection is provided, the error message is stored in it. If NULL, an exception is raised if res is not TRUE.

var.name

[character(1)]
The custom name for x as passed to any assert* function. Defaults to a heuristic name lookup.