If you have a polygon for the entire area and one for the area of interest
within it; then I think you could use rgeos::gDifference to create the
polygon you need.
Robert


On Thu, Nov 15, 2012 at 6:19 AM, peleve <pitiur@gmail.com> wrote:

> Thank you very much.  That worked, mostly!?!  But I see the methodology
> now.
> I had been thinking about masks, but I was asking the wrong question I now
> realize.
> In my real application, using your approach, I still have some unwanted
> bits
> left outside of the polygon.  I traced it as a left over piece from
> contouring the data... contours are vector objects. Your suggestion works
> for the raster object,  and worked for the Akima result (outside the
> polygon
> and inside the convex polygon that Akima works in).
> I now realize that what I need is a hole in a polygon, outside colored
> white, inside transparent, or a polygon with everything outside white and
> inside transparent. The hole is the outline of the area with the contours
> within the bounding box.
> Any thoughts on how to do that?
> Thank you again.
>
>
> I think you can do:
>
> x <- raster(akima)
> y <- mask( x, SpP[2] )
> plot(y)
>
>
>
>
>
>
> --
> View this message in context:
> http://r-sig-geo.2731867.n2.nabble.com/Clearing-the-area-outside-of-a-polygon-defined-on-a-grid-tp7581718p7581721.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

