check: Validate S3 classes from pensieve

Description Usage Arguments

View source: R/checks.R

Description

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

Check S3 class.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
check(x)

test(x)

## Default S3 method:
test(x)

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

## Default S3 method:
expect(x, info = NULL, label = paste(class(x), "S3 class"))

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

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

need(x, label = NULL)

## Default S3 method:
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.


maxheld83/pensieve documentation built on Jan. 21, 2020, 9:16 a.m.