Re: [R-sig-Geo] convert from spatstat to sp; RFC about generic behaviour

2010-10-30 Thread Edzer Pebesma
] 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

Re: [R-sig-Geo] convert from spatstat to sp; RFC about generic behaviour

2010-10-30 Thread Robert J. Hijmans
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

[R-sig-Geo] convert from spatstat to sp

2010-10-29 Thread Peter Larson
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

Re: [R-sig-Geo] convert from spatstat to sp

2010-10-29 Thread Robert J. Hijmans
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

Re: [R-sig-Geo] convert from spatstat to sp

2010-10-29 Thread Edzer Pebesma
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),

Re: [R-sig-Geo] convert from spatstat to sp

2010-10-29 Thread Turner Rolf
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