2

When I was trying to create a spatial point data frame in R a sudden error appeared that made it unable for me to create a new SpatialPointdataFrame. The odd thing was that earlier I used the exact same code as before and it succeeded before.

spwolfsummer20M17 <- SpatialPointsDataFrame(coords = wolfsummer20M17[,c("RT90X", "RT90Y")], 
                                            proj4string = CRS("+init=epsg:3021"), 
                                            data = data.frame(wolfsummer20M17=(wolfsummer20M17[,2])))

Which followed in the following error message:

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

I found the origin of the error in this case lied at the hand of installing a package called "tidyselect".

I solved this with shutting RStudio down and restarting RStudio again.

However, when I searched this problem, multiple people already had similar problems which had their questions not answered.

So if anyone knows why this error actually gets caused, please feel free to explain and provide possible solutions (instead of just restarting the program).

Phil
  • 7,287
  • 3
  • 36
  • 66

0 Answers0