6

I am trying to reproduce the example posted on

Extracting intersection areas in R

Although, when I try to create the SpatialPolygon "p2", R returns the error: "Error in as.vector(x) : no method for coercing this S4 class to a vector".

Any suggestions why is it happening? How can I fix it?

  • The exampled worked perfectly for me. I suggest checking that all the needed libraries in the example were loaded without any problem! – Guz Feb 23 '17 at 18:08

1 Answers1

10

The intersect function is masked. Try raster::intersect() instead of intersect().

aldo_tapia
  • 13,560
  • 5
  • 30
  • 56
dwolf
  • 311
  • 3
  • 12