Skip to content

These are methods for the dplyr generics intersect(), union(), union_all(), and setdiff(). They are translated to data.table::fintersect(), data.table::funion(), and data.table::fsetdiff().

Usage

# S3 method for dtplyr_step
intersect(x, y, ...)

# S3 method for dtplyr_step
union(x, y, ...)

# S3 method for dtplyr_step
union_all(x, y, ...)

# S3 method for dtplyr_step
setdiff(x, y, ...)

Arguments

x, y

A pair of lazy_dt()s.

...

Ignored

Examples

dt1 <- lazy_dt(data.frame(x = 1:4))
dt2 <- lazy_dt(data.frame(x = c(2, 4, 6)))

intersect(dt1, dt2)
#> Source: local data table [2 x 1]
#> Call:   fintersect(`_DT15`, `_DT16`)
#> 
#>       x
#>   <int>
#> 1     2
#> 2     4
#> 
#> # Use as.data.table()/as.data.frame()/as_tibble() to access results
union(dt1, dt2)
#> Source: local data table [5 x 1]
#> Call:   funion(`_DT15`, `_DT16`)
#> 
#>       x
#>   <dbl>
#> 1     1
#> 2     2
#> 3     3
#> 4     4
#> 5     6
#> 
#> # Use as.data.table()/as.data.frame()/as_tibble() to access results
setdiff(dt1, dt2)
#> Source: local data table [2 x 1]
#> Call:   fsetdiff(`_DT15`, `_DT16`)
#> 
#>       x
#>   <int>
#> 1     1
#> 2     3
#> 
#> # Use as.data.table()/as.data.frame()/as_tibble() to access results