Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘select’ for signature ‘"spec_tbl_df"’

Tags:

r

csv

dbf

I am having this error code appear on in my project.

the strange thing is, the piece of code I am using was working perfectly earlier today. However, since I installed an update for R I am now getting this message when running it.

df1 <- df %>% select(Month, Longitude, Latitude, Type)

Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘select’ for signature ‘"spec_tbl_df"’

The code was used simply to create a new data frame with only the selected columns.

Any help would be greatly appreciated!

like image 460
T.Omalley Avatar asked Apr 25 '20 15:04

T.Omalley


1 Answers

A new version of R has recently been released: 4.0.0.

There has been some major changes, see here for a list. The documentation says that this might have broken some methods that were based on R 3.6.* behavior. Maybe the method for the class spec_tbl_df was relying on something that changed.

That's a clue more than a definitive answer, maybe some users will give you a better one

Update

Given the issue here, it looks like there exists a conflict between the base R select method and dplyr::select method for objects of class spec_tbl_df. In that case, the easiest solution is to ensure you use dplyr namespace by using the dplyr::select syntax.

like image 162
linog Avatar answered Nov 15 '22 07:11

linog