You can easily clip rasters with polygons (or other rasters) via raster
package.

See this recent
thread<http://r-sig-geo.2731867.n2.nabble.com/Clip-a-raster-td5635474.html>for
one example using crop() and polygonsToRaster() functions. Other than
that, the packages has comprehensive vignettes and maybe that's the place to
start.

Cheers,
Roman




On Tue, Oct 19, 2010 at 1:41 PM, Thiago Veloso <thi_veloso@yahoo.com.br>wrote:

>   Dear R-SIGgers,
>   My current rainfall dataset (ascii, at 0.2 degree resolution) spans the
> entire South America and has been loaded into R as a xyz variable:
> > summary(prec_data)       V1               V2               V3
>    Min.   :-82.80   Min.   :-50.20   Min.   :  0.000   1st Qu.:-70.65   1st
> Qu.:-34.65   1st Qu.:  0.000   Median :-58.50   Median :-19.10   Median :
>  0.000   Mean   :-58.50   Mean   :-19.10   Mean   :  4.002   3rd Qu.:-46.35
>   3rd Qu.: -3.55   3rd Qu.:  2.430   Max.   :-34.20   Max.   : 12.00   Max.
>   :250.150  > head(prec_data)     V1    V2   V31 -82.8 -50.2 0.002 -82.8
> -50.0 1.363 -82.8 -49.8 2.864 -82.8 -49.6 3.635 -82.8 -49.4 3.266 -82.8
> -49.2 3.40>
>   My objectives are the following:
>   1) Clip the data using a shapefile;
>   2) In order to completely fill the area with rainfall information,
> perform a interpolation technique (IDW or kriging) using as boundary the
> same shapefile above. This will allow me to generate risk maps for the
> occurence of a certain plant disease.
>   Could anybody please point me the directions on how to do this?
>   Thanks in advance,
>   Thiago.
>
>
>
>        [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>


-- 
In God we trust, all others bring data.

	[[alternative HTML version deleted]]

