] convert from spatstat to sp
Hello all,
Is there any way to convert from spatstat to sp?
Specifically, I am looking to clip a density plot produced in spatstat
to include only points within a polygon boundary in a shapefile. if
there is a way to clip in spatstat, this would also be acceptable
a.m.
To: r-sig-geo@stat.math.ethz.ch
Subject: [R-sig-Geo] convert from spatstat to sp
Hello all,
Is there any way to convert from spatstat to sp?
Specifically, I am looking to clip a density plot produced in spatstat
to include only points within a polygon boundary in a shapefile
Hello all,
Is there any way to convert from spatstat to sp?
Specifically, I am looking to clip a density plot produced in spatstat
to include only points within a polygon boundary in a shapefile. if
there is a way to clip in spatstat, this would also be acceptable.
Any ideas?
Thanks
pete
Peter,
If this is an im object you can use
library(raster)
r - raster(im)
r - polygonsToRaster(pols, r, mask=TRUE)
You can also use the coercion methods between spatsat and sp that are
available in maptools and then use sp overlay methods
I do not know if you can clip in spatstat, but I would
There is; if your question is about converting an object of class im
(spatstat) to an object of class SpatialGridDataFrame (sp), it is in
package maptools:
library(spatstat)
whitenoise - im(matrix(rnorm(1200),30,40))
library(maptools)
x = as(as(whitenoise, SpatialGridDataFrame),
From: r-sig-geo-boun...@stat.math.ethz.ch [r-sig-geo-boun...@stat.math.ethz.ch]
On Behalf Of Peter Larson [pslars...@gmail.com]
Sent: Saturday, 30 October 2010 8:28 a.m.
To: r-sig-geo@stat.math.ethz.ch
Subject: [R-sig-Geo] convert from spatstat to sp