From ea6c3ff5a9153175c4a77f980b8470d3fac2f619 Mon Sep 17 00:00:00 2001 From: tilltnet Date: Wed, 31 Jan 2024 19:35:05 -0800 Subject: [PATCH] feat: added method for `dplyr::distinct()`, closes #63 --- NAMESPACE | 1 + R/dplyr_methods.R | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/NAMESPACE b/NAMESPACE index be5ea2d..deaaf6d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -22,6 +22,7 @@ S3method(as_tibble,egor) S3method(clustered_graphs,data.frame) S3method(clustered_graphs,egor) S3method(clustered_graphs,list) +S3method(distinct,egor) S3method(distinct_all,egor) S3method(distinct_at,egor) S3method(distinct_if,egor) diff --git a/R/dplyr_methods.R b/R/dplyr_methods.R index 4c458bc..39df467 100644 --- a/R/dplyr_methods.R +++ b/R/dplyr_methods.R @@ -945,6 +945,18 @@ append_cols <- function(.egor, ...) { # distinct ---------------------------------------------------------------- +#' @export +#' @noRd +#' @method distinct egor +distinct.egor <- function(.tbl, + .funs = list(), + ..., + .keep_all = FALSE) { + result <- + distinct(.tbl[[attr(.tbl, "active")]], .funs = list(), ..., .keep_all = FALSE) + return_egor_with_result(.tbl, result) +} + #' @export #' @noRd #' @method distinct_all egor