observe_if {observer} | R Documentation |
Observe your data
Description
observe_if
identifies rows of .data
where the predicates
tested fail.
Usage
observe_if(.data, ..., .append = TRUE)
observe_if_(.data, ..., .dots, .append = TRUE)
## S3 method for class 'data.frame'
observe_if_(.data, ..., .dots, .append = TRUE)
## S3 method for class 'tbl_df'
observe_if_(.data, ..., .dots, .append = TRUE)
## S3 method for class 'grouped_df'
observe_if_(.data, ..., .dots, .append = TRUE)
observe(.data, ...)
## Default S3 method:
observe(.data, ...)
Arguments
.data |
A tbl or data.frame. |
... |
Logical predicates. Multiple conditions are considered as separate observations. |
.append |
logical. If |
.dots |
Used to work around non-standard evaluation. |
Value
.data
is returned together with an observations
attribute.
This attribute is a data frame (actually a tibble
)
which contains all check runs.
Examples
library(magrittr)
df <- data.frame(x = 1:3, y = 2:4)
df %>%
observe_if(y-x==1) %>%
observe_if(x < 3) %>%
observe_if(y < 4, x > 1) %>%
obs()
[Package observer version 0.1.2 Index]