Skip to content

Commit

Permalink
lintr
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Dec 18, 2023
1 parent 0e3991b commit 6bfe443
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions R/data_match.R
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ data_filter <- function(x, ...) {
#' @export
data_filter.data.frame <- function(x, ...) {
out <- x
dots <- match.call(expand.dots = FALSE)$`...`
dots <- match.call(expand.dots = FALSE)[["..."]]

if (any(nchar(names(dots)) > 0)) {
if (any(nzchar(names(dots), keepNA = TRUE))) {
insight::format_error(
"Filtering did not work. Please check if you need `==` (instead of `=`) for comparison."
)
Expand Down Expand Up @@ -280,11 +280,11 @@ data_filter.grouped_df <- function(x, ...) {
grps <- attr(x, "groups", exact = TRUE)
grps <- grps[[".rows"]]

dots <- match.call(expand.dots = FALSE)$`...`
dots <- match.call(expand.dots = FALSE)[["..."]]
out <- lapply(grps, function(grp) {
args <- list(x[grp, ])
args <- c(args, dots)
do.call("data_filter.data.frame", args)
arguments <- list(x[grp, ])
arguments <- c(arguments, dots)
do.call("data_filter.data.frame", arguments)
})

out <- do.call(rbind, out)
Expand Down

0 comments on commit 6bfe443

Please sign in to comment.