2

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.

fdetsch
  • 5,239
  • 3
  • 30
  • 58
egig
  • 4,370
  • 5
  • 29
  • 50
  • Your packages got updated in the process and package sp has removed the `overlay` function. Update your code to reflect that change (I assume there is a now preferred alternative). – Roland Apr 08 '16 at 07:10
  • Thanks @Roland, for short term fix I need to downgrade the sp package version, do you know where to get older version of sp package ?? – egig Apr 08 '16 at 07:23
  • https://cran.r-project.org/web/packages/sp/index.html – Roland Apr 08 '16 at 07:25

1 Answers1

3

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.

fdetsch
  • 5,239
  • 3
  • 30
  • 58