Skip to contents

Get the dtrackr excluded data record

Usage

excluded(.data, simplify = TRUE)

Arguments

.data

a dataframe which may be grouped

simplify

return a single summary dataframe of all exclusions.

Value

a new dataframe of the excluded data up to this point in the workflow. This dataframe is by default flattened, but if .simplify=FALSE has a nested structure containing records excluded at each part of the pipeline.

Examples

library(dplyr)
library(dtrackr)
tmp = iris %>% track() %>% capture_exclusions()
tmp %>% exclude_all(
   Petal.Length > 5.8 ~ "{.excluded} long ones",
   Petal.Length < 1.3 ~ "{.excluded} short ones",
   .stage = "petal length exclusion"
) %>% excluded()
#> # A tibble: 17 × 9
#>    .stage     .strata .message Sepal.Length Sepal.Width Petal.Length Petal.Width
#>    <chr>      <chr>   <glue>   <chr>        <chr>       <chr>        <chr>      
#>  1 petal len… ""      13 long… 6.3          3.3         6            2.5        
#>  2 petal len… ""      13 long… 7.1          3           5.9          2.1        
#>  3 petal len… ""      13 long… 7.6          3           6.6          2.1        
#>  4 petal len… ""      13 long… 7.3          2.9         6.3          1.8        
#>  5 petal len… ""      13 long… 7.2          3.6         6.1          2.5        
#>  6 petal len… ""      13 long… 7.7          3.8         6.7          2.2        
#>  7 petal len… ""      13 long… 7.7          2.6         6.9          2.3        
#>  8 petal len… ""      13 long… 7.7          2.8         6.7          2          
#>  9 petal len… ""      13 long… 7.2          3.2         6            1.8        
#> 10 petal len… ""      13 long… 7.4          2.8         6.1          1.9        
#> 11 petal len… ""      13 long… 7.9          3.8         6.4          2          
#> 12 petal len… ""      13 long… 7.7          3           6.1          2.3        
#> 13 petal len… ""      13 long… 6.8          3.2         5.9          2.3        
#> 14 petal len… ""      4 short… 4.3          3           1.1          0.1        
#> 15 petal len… ""      4 short… 5.8          4           1.2          0.2        
#> 16 petal len… ""      4 short… 4.6          3.6         1            0.2        
#> 17 petal len… ""      4 short… 5            3.2         1.2          0.2        
#> # ℹ 2 more variables: Species <chr>, .filter <chr>