Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Problem with select() and filter() #7093

Closed
paschatz opened this issue Oct 10, 2024 · 2 comments
Closed

Problem with select() and filter() #7093

paschatz opened this issue Oct 10, 2024 · 2 comments

Comments

@paschatz
Copy link

paschatz commented Oct 10, 2024

Hey,

Sometimes I face problems with dplyr functions. Today I consistently get different errors when I use filter:
e.g:

test <- metadata %>%
+   filter(plot == "C1", year_n == 2020)
Error: object 'year_n' not found

year_n exists on my data and If I run the code with dplyr::filter() then runs smoothly.
The same applies when I use the select()

species_sub <- species %>%
+   select(which(colSums(species) > 10))
Error: unable to find an inherited method for function ‘select’ for signature ‘x = "tbl_df"’

Again, once I use dplyr::select() the problem is resolved!

I am using M1, R4.4.1, Rstudio 2024.09.0+375, tidyverse 2.0.0 (with dplyr 1.1.4).

I restarted Rstudio, deactivated all the packages and loaded only dplyr and the problem persisted.

Thank you in advance,
Paschalis

@DavisVaughan
Copy link
Member

Are you sure you loaded dplyr? It looks like (possibly) stats::filter() and MASS::select() are running instead.

Either:

  • Something else is masking filter and select
  • You don't actually have dplyr loaded

@paschatz
Copy link
Author

I am using tidyverse but i tried only loading dplyr and the problem persisted.

Apparently it was a dependancy issue with automap.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants