Skip to content

Commit

Permalink
improved text in example with raise
Browse files Browse the repository at this point in the history
  • Loading branch information
edwindj committed Sep 3, 2018
1 parent 07181c0 commit b0835c1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/vignettes/introduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,17 @@ summary(cf[c(1,3)])


### Confrontation options
By default, all errors and warnings are caught when validation rules are confronted with data. This can be switched off by setting the `raise` option to `"errors"` or `"all"`, e.g. here, the error is caught,
By default, all errors and warnings are caught when validation rules are confronted with data. This can be switched off by setting the `raise` option to `"errors"` or `"all"`. The following
example contains a specification error: `hite` should be `height` and therefore the rule errors
on the `women` data.frame because it does not contain a column `hite`. The error is caught
(not resulting in a R error) and shown in the summary,
```{r}
v <- validator(hite > 0, weight>0)
summary(confront(women, v))
```
while here it is raised immediately.
Setting `raise` to `all` results in a R error:

```{r eval=FALSE}
```{r eval=TRUE, error=TRUE}
# this gives an error
confront(women, v, raise='all')
```
Expand Down

0 comments on commit b0835c1

Please sign in to comment.