Skip to content

Commit 83bdbf4

Browse files
committed
improved example for simplify_conditional
1 parent a02d37a commit 83bdbf4

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

examples/simplify_conditional.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
library(validate)
22

3+
# superfluous conditions
4+
rules <- validator(
5+
r1 = if (x > 0) x < 1,
6+
r2 = if (x > 0 && x > 1) y > 0
7+
)
8+
# r1 means that x > 0 is superfluous
9+
# r2 means that x > 0 is superfluous
10+
simplify_conditional(rules)
11+
312
# non-relaxing clause
413
rules <- validator( r1 = if (x > 1) y > 3
514
, r2 = y < 2

man/simplify_conditional.Rd

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)