[R-sig-Geo] Error in eCclipbool - Incorrect number of arguments (9), expecting 8 for 'Cclipbool

Joe Lewis jo@eph|ew|@1992 @end|ng |rom gm@||@com
Tue Apr 14 16:36:26 CEST 2020


Hi,

I'm trying to create an owin object from a SpatialPolygons, but I'm getting
the following error:

Error in .Call(eCclipbool, A, B, pftA, pftB, ct, x0, y0, eps, closed,  :
Incorrect number of arguments (9), expecting 8 for 'Cclipbool'

I'm using as.owin.SpatialPolygons from the Maptools package.

Reproducible example:

x <- raster::getData(name = "GADM", country = "GBR", level = 3)

x <- x[x$NAME_3 == "Falkirk",]

osgb <- "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000
+y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs"

x <- sp::spTransform(x, osgb)

x <- rgeos::gSimplify(x, tol = 4, topologyPreserve = TRUE)

# this works fine.
x1 <-  maptools::as.owin.SpatialPolygons(as(raster::extent(x),
"SpatialPolygons"))

# this causes the above error
x2 <-  maptools::as.owin.SpatialPolygons(x, "SpatialPolygons")

---

Session Info:

R version 3.4.1 (2017-06-30)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.3            lattice_0.20-35       codetools_0.2-15
 deldir_0.1-25         grid_3.4.1
 [6] nlme_3.1-131          tensor_1.5            raster_2.8-19
spatstat_1.63-3.032   sp_1.3-1
[11] rpart_4.1-12          goftest_1.2-2         Matrix_1.2-10
spatstat.utils_1.17-0 rgdal_1.4-3
[16] tools_3.4.1           foreign_0.8-69        polyclip_1.10-0.001
spatstat.data_1.4-3   abind_1.4-5
[21] compiler_3.4.1        maptools_0.9-9        mgcv_1.8-17
rgeos_0.4-3

Any help would be appreciated.

Thank you.

Kind regards,
Joseph Lewis

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list