tar_assert: Assertions

Description Usage Arguments See Also Examples

Description

These functions assert the correctness of user inputs and generate custom error conditions as needed. Useful for writing packages built on top of targets.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

Arguments

x

R object, input to be validated. The kind of object depends on the specific assertion function called.

msg

Character of length 1, a message to be printed to the console if x is invalid.

choices

Character vector of choices of x for certain assertions.

threshold

Numeric of length 1, lower/upper bound for assertions like tar_assert_le()/tar_assert_ge().

y

R object, value to compare against x.

class

Character vector of expected class names.

package

Character of length 1, name of an R package.

path

Character, file path.

pattern

Character of length 1, a grep pattern for certain assertions.

See Also

Other utilities to extend targets: tar_condition, tar_dir(), tar_language, tar_test()

Examples

1
2

targets documentation built on July 21, 2021, 5:07 p.m.