Skip to content

This is a method for the dplyr::union() generic. union(x, y) finds all rows in either x or y, excluding duplicates. The implementation forwards to distinct(union_all(x, y)).

Usage

# S3 method for class 'duckplyr_df'
union(x, y, ...)

Arguments

x, y

Pair of compatible data frames. A pair of data frames is compatible if they have the same column names (possibly in different orders) and compatible types.

...

These dots are for future extensions and must be empty.

See also

Examples

df1 <- duckdb_tibble(x = 1:3)
df2 <- duckdb_tibble(x = 3:5)
union(df1, df2)
#> # A duckplyr data frame: 1 variable
#>       x
#>   <int>
#> 1     5
#> 2     2
#> 3     3
#> 4     4
#> 5     1