Joseph Stover
Joseph Stover

Reputation: 427

dplyr select is claiming that I have extra arguments that are not there

data <- tibble(x = 1:5, y = 6:10)
data %>% select(x)

returns

Error: `...` is not empty.

We detected these problematic arguments:
* `logical`

These dots only exist to allow future extensions and should be empty.
Did you misspecify an argument?

I can not figure out what is causing this error. I've tried reinstalling dplyr, restarting R, restarting the computer. Any suggestions would be appreciated. Running slang::last_error() gives

<error/rlib_error_dots_nonempty>
`...` is not empty.

We detected these problematic arguments:
* `logical`

These dots only exist to allow future extensions and should be empty.
Did you misspecify an argument?
Backtrace:
  9. dplyr::select(., x)
 11. tidyselect::vars_select(tbl_vars(.data), !!!enquos(...))
 12. tidyselect:::eval_select_impl(...)
 20. tidyselect:::vars_select_eval(...)
 21. tidyselect:::walk_data_tree(expr, data_mask, context_mask)
 22. tidyselect:::eval_c(expr, data_mask, context_mask)
 23. tidyselect:::reduce_sels(node, data_mask, context_mask, init = init)
 24. tidyselect:::walk_data_tree(init, data_mask, context_mask)
 25. tidyselect:::as_indices_sel_impl(...)
 26. tidyselect:::as_indices_impl(x, vars, strict = strict)
 27. vctrs::vec_as_subscript(x, logical = "error")
 28. ellipsis::check_dots_empty()
 29. ellipsis:::action_dots(...)
Run `rlang::last_trace()` to see the full context.

Upvotes: 0

Views: 5984

Answers (4)

Sapiens
Sapiens

Reputation: 1901

I found many solutions pointing at a new installation, so I will suggest the programmatical solution I found for another dplyr verb: slice_max(.data, order_by, ..., n)

I found the error you reported when I used: data %>% slice_max(order_by = column_in_data, 10)

I corrected it by explicitly indicating the input name: data %>% slice_max(order_by = column_in_data, n = 10)

Upvotes: 1

Michael Dewar
Michael Dewar

Reputation: 3318

I had a similar problem right after I installed a new package that resulted in many other packages being updated. I think one of them got corrupted. Installing the dev version of dplyr had no effect, nor did reinstalling the normal dplyr.

What ended up working for me was to reinstall all of the packages mentioned in the rlang::last_error() backtrace.

Upvotes: 2

foeffa
foeffa

Reputation: 1

I had the same thing occur. Pretty much out of the blue. Happened with tidyr::separate, So it probably propagates from dplyr into other packages depending on it. Happened on code that had no issue running previously.

Also managed to solve it by installing the dev version of dplyr, but I find this a very tricky solution. :/

Upvotes: 0

akrun
akrun

Reputation: 887821

We can install the devel version of dplyr and it could solve the issue

devtools::install_github("tidyverse/dplyr")

Upvotes: 0

Related Questions