Hi, I am having an error loading mapview. I can install the package, but when I go to load the package, I get the below error:
library(mapview)
Error: package or namespace load failed for ‘mapview’:
Function found when exporting methods from the namespace ‘raster’ which is not S4 generic: ‘all.equal’
In addition: Warning message:
no function found corresponding to methods exports from ‘raster’ for: ‘direction’, ‘gridDistance’
I also can't do the tutorial where you are supposed to view the breweries. When I do mapview(breweries), I get the following error:
mapview(breweries)
Error in mapview(breweries) : could not find function "mapview"
Have you got any error message while installing raster? Please post the complete output message you get when you try to install it, that could give us another clue about what the problem is.
Good morning,
I have the same issue with using R 4.1.2.
I had no error message with the install.packages('raster') but the library(raster) step return the following message:
library(raster)
Error: package or namespace load failed for ‘raster’:
Function found when exporting methods from the namespace ‘raster’ which is not S4 generic: ‘all.equal’
In addition: Warning message:
no function found corresponding to methods exports from ‘raster’ for: ‘direction’, ‘gridDistance’.
Thanks for your help. I've tried uninstalling and then installing rtools, raster, then mapview, and I am still having the same issues. When I try to load raster, I get the below error:
library(raster)
Loading required package: sp
Error: package or namespace load failed for ‘raster’:
Function found when exporting methods from the namespace ‘raster’ which is not S4 generic: ‘all.equal’
In addition: Warning message:
no function found corresponding to methods exports from ‘raster’ for: ‘direction’, ‘gridDistance’
I was trying to load the unmarked package and got the same error message. I didn't try to reinstall Rtools but if I ran the single line of code and then library(raster) it solved the problem. Then, if I ran library(unmarked) the package loaded properly.
I am having the same problem as pioneer and yourself. I tried using your solution and received this message when trying install.packages('raster', repos='h ttps://rspatial.r-universe.dev'):
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
h ttps://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/thoma/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
Warning in install.packages :
unable to access index for repository h ttps://rspatial.r-universe.dev /src/contrib:
cannot open URL 'h ttps://rspatial.r-universe.dev /src/contrib/PACKAGES'
Warning in install.packages :
package ‘raster’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
h ttps://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
Warning in install.packages :
unable to access index for repository h ttps://rspatial.r-universe.dev /bin/windows/contrib/4.1:
cannot open URL 'h ttps://rspatial.r-universe.dev /bin/windows/contrib/4.1/PACKAGES'
Ignore the spaces in each 'https'. I had to break the links in this post because I am a new user on this site and cannot include multiple links in a post.
In your case it seems that you need to uninstall if you alread have it and then reinstall the latest version of Rtools before running this command. Also, be sure that you're using the latest version of R. I am currently running R4.1.2 and it may not cause a problem but it is worth always having the latest version of R.
Could you share with us how is the procedure of installing RTools and installing the raster package from it?
I have tried to install the raster package many times but i always get the error message:
"Function found when exporting methods from the namespace ‘raster’ which is not S4 generic: ‘all.equal’"