Error messase when using filter function

Hello,
A script that worked well is now sending me error messages when using the filter function (dplyr package).
Has anyone encountered this type of message before?
I updated packages and R version but it did not fix the problem.
Thank you

d <- filter(d, X0003_No_declaration != "202138BF7")
Erreur : Internal error in df_slice(): Columns must match the data frame size.
Run rlang::last_error() to see where the error occurred.
rlang::last_error()
<error/rlang_error>
Internal error in df_slice(): Columns must match the data frame size.
Backtrace:

  1. dplyr::filter(d, X0003_No_declaration != "202138BF7")
  2. dplyr:::filter.data.frame(d, X0003_No_declaration != "202138BF7")
  3. dplyr:::dplyr_row_slice.data.frame(.data, loc, preserve = .preserve)
  4. vctrs::vec_slice(data, i)
    Run rlang::last_trace() to see the full context.

I find that sometimes dplyr's function get confused with the base function they are masking, particularly select and dplyr. I now always write dplyr::select and dplyr::filter. summarise might be another one. Does this help?

Thank you very much for your answer.
Unfortunately it doesn't work, very strange because the same simple code with "filter" runs with no problem higher in the script...
But I also noticed the same kind of problem with "select" !
If another idea comes up, don't hesitate to share :slight_smile:

Did you load other packages anywhere in between?
I had a similar issue as some point loading plyr after loading dplyr (or tidyverse in general) and there was obviously a conflict returning errors.
Loading tidyverse after the other packages solved the issue. Maybe worth checking.

Maybe the problem is not with your code but with the specific data being used, to help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.