[R-sig-Geo] marked ppp-object

Rolf Turner r.turner at auckland.ac.nz
Thu Oct 21 21:04:29 CEST 2010


On 22/10/2010, at 2:00 AM, Dorothea Lemke wrote:

> Hi list,
> 
> that's probably an easy question but I couldn't get it right.
> I want to coerce a SpatialPointsDataFrame to a marked ppp- object. But I don't
> know how to attach the marks to the ppp-object.

	<SNIP>

If you have created an object X which is an object of class "ppp", and
you have a vector x which you wish to be the marks of X, just do

	marks(X) <- x

The vector x should be either numeric or a factor, and should be of length
equal to the number of points in the point pattern X.

I your particular case I think that (something like)

	temp <- readOGR(".","C67mF_K)
	C67mF_K <- as(temp,"ppp")
	marks(C67mF_K) <- temp at data$typ

should work.


	cheers,

		Rolf Turner


More information about the R-sig-Geo mailing list