Hi,


I need to create a number of random points inside a polygon using car
{splancs}.


Let's say I have a SpatialPolygonsDataFrame with only one polygon, and I
want to throw 100 points inside randomly.


If the object is called poly1, I thought this would work:


>csr(poly1,100)


But I get the error:


Error in `[.data.frame`(x@data, i, j, ..., drop = FALSE) :

  undefined columns selected


I thought this might have to do with the class, so I did:


>teste <- slot(poly1,"polygons")


And tried

>csr(teste,100)


Now I get:

Error in poly[, 1] : incorrect number of dimensions


I apologise if this is a very simple question.

Thanks in advance,

António

	[[alternative HTML version deleted]]

