问题
I reinstalled my pc and also reinstalled R, but I somehow get an error when running my R program:
Error: could not find function "overlay"
which was fine on the previous installation.
The new R version is 3.2.4., so I tried to downgrade the version to 3.1.* and 3.0.*, but this was not helpful.
Libraries I used are:
library(sp)
library(maptools)
library(gstat)
library(rgdal)
library(sm)
library(png)
It seems like overlay
is included in the sp package. I don't know what to do.
回答1:
overlay
is deprecated, see http://www.inside-r.org/packages/cran/sp/docs/overlay (and section 'Note' therein). It has been replaced with over
that seemingly overcomes a set of inconsistencies associated with overlay
. Edzer wrote a nice vignette about Map overlay and spatial aggregation in sp using the over
function - you should probably have a look at it.
来源:https://stackoverflow.com/questions/36493476/error-could-not-find-function-overlay-after-reinstall