distinct.tbl_lazy {dbplyr} | R Documentation |
Subset distinct/unique rows
Description
This is a method for the dplyr distinct()
generic. It adds the
DISTINCT
clause to the SQL query.
Usage
## S3 method for class 'tbl_lazy'
distinct(.data, ..., .keep_all = FALSE)
Arguments
.data |
A lazy data frame backed by a database query. |
... |
< |
.keep_all |
If |
Value
Another tbl_lazy
. Use show_query()
to see the generated
query, and use collect()
to execute the query
and return data to R.
Examples
library(dplyr, warn.conflicts = FALSE)
db <- memdb_frame(x = c(1, 1, 2, 2), y = c(1, 2, 1, 1))
db %>% distinct() %>% show_query()
db %>% distinct(x) %>% show_query()
[Package dbplyr version 2.5.0 Index]