Skip to content

Commit

Permalink
damn
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Sep 9, 2024
1 parent 07b67fa commit e3e2523
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions R/utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ n_unique <- function(x, ...) {

#' @rdname trim_ws
#' @export
n_unique.default <- function(x, remove_na = TRUE, na.rm, ...) {
n_unique.default <- function(x, remove_na = TRUE, na.rm = TRUE, ...) {
if (is.null(x)) {
return(0)
}
Expand All @@ -103,23 +103,23 @@ n_unique.default <- function(x, remove_na = TRUE, na.rm, ...) {
}

#' @export
n_unique.data.frame <- function(x, remove_na = TRUE, na.rm, ...) {
n_unique.data.frame <- function(x, remove_na = TRUE, na.rm = TRUE, ...) {
## TODO:: remove deprecation warning later
if (!missing(na.rm)) {
format_warning("The `na.rm` argument is deprecated. Use `remove_na` instead.")
remove_na <- na.rm
}
vapply(x, n_unique, na.rm = remove_na, FUN.VALUE = numeric(1L))
vapply(x, n_unique, remove_na = remove_na, FUN.VALUE = numeric(1L))
}

#' @export
n_unique.list <- function(x, remove_na = TRUE, na.rm, ...) {
n_unique.list <- function(x, remove_na = TRUE, na.rm = TRUE, ...) {
## TODO:: remove deprecation warning later
if (!missing(na.rm)) {
format_warning("The `na.rm` argument is deprecated. Use `remove_na` instead.")
remove_na <- na.rm
}
lapply(x, n_unique, na.rm = remove_na)
lapply(x, n_unique, remove_na = remove_na)
}


Expand Down Expand Up @@ -155,7 +155,7 @@ safe_deparse_symbol <- function(x) {

#' @rdname trim_ws
#' @export
has_single_value <- function(x, remove_na = FALSE, na.rm, ...) {
has_single_value <- function(x, remove_na = FALSE, na.rm = TRUE, ...) {
## TODO:: remove deprecation warning later
if (!missing(na.rm)) {
format_warning("The `na.rm` argument is deprecated. Use `remove_na` instead.")
Expand Down

0 comments on commit e3e2523

Please sign in to comment.