Hello R users, I am trying to export an object of class "owin" from the Spatstat package to an ESRI shapefile using the package Maptools. I am using the function "writePolyShape"; "pointsp" is an object of class "ppp", "ripras" is a function in SpatStat that creates a polygon around points. I have tried with several different owin objects and each time I get the same error, as follows.
x=ripras(pointsp,shape="convex") > xpoly=as(x,"SpatialPolygons") > xpolyframe=as(xpoly,"SpatialPolygonsDataFrame") > class(xpolyframe) [1] "SpatialPolygonsDataFrame" attr(,"package") [1] "sp" > writePolyShape(xpolyframe,"pgon") Error in write.polylistShape(pls, df, file = fn, factor2char = factor2char, : different number of rows in polylist and data frame thanks for any help, Tom Elliott, Central Washington University > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.