Dear all, I had to place points at random, one in each of larger number of polygons (actually in objects of class 'SpatialPolygonsDataFrame' , see sp library), and tried first to do it using spsample (from sp). Surprisingly, every 5-15 trials, the output was a NULL value. The doc says that ' this may occur when trying to hit a small and awkwardly shaped polygon in a large bounding box with a small number of points', but in my case, the shapes were not really awkward, and the bounding box just the smallest rectangle including the shape, just the number of points was 1 in each polygon.
Thus I tried csr (from splancs) after having extracted the polygon coordinates of each shape from the Spatial object, and everything went smoothly, with hit success every trial. Has anybody (anybody will probably be Edzer or/and Roger...) an idea why here splancs looks like outperforming spsample ? Patrick ______________________________________________ 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.