[R-sig-eco] arcgis grid analysis with R

Kingsford Jones kingsfordjones at gmail.com
Mon May 26 17:17:29 CEST 2008


Hi Kathy

There's a wealth of options for working with spatial data in R.  You
may want to take a look at the Spatial Task View:
http://cran.r-project.org/web/views/Spatial.html

Some packages I've had good luck with for importing and analyzing
ecological spatial data include sp, rgdal, maptools, PBSmapping, and
adehabitat.

Here's one strategy for the task you describe (assuming you're working
with a shapefile and an exported ESRI ASCII raster)

- load the maptools package (which will also load the sp package)
- read in the shapefile with readShapePoly
- read the grid with readAsciiGrid
- use the overlay function to extract the values of the polygons for
each cell of the grid
- use the tapply function with the original grid values as X, the grid
values with the overlayed polygon values as the INDEX, and a function
to make the plots or analyses of your choice as the FUN argument.

If you run into technical difficulties you might have the best luck
getting answers on the R-SIG-GEO list, which is linked on the Task
View page.

hope that helps,

Kingsford Jones



On Sun, May 25, 2008 at 2:43 PM, Boomer, Kathy <boomerk at si.edu> wrote:
>
> I would like to plot histograms of of gridded (elevation-derived) data for all (10-20) polygons in a shapefile.  Because ArcGIS has limited capabilities for statistical analysis, I hope it will be fairly straight-forward to conduct such an analysis in R.
>
> Thank you in advance for any help or direction anyone can provide.
>
> Kathy Boomer
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>



More information about the R-sig-ecology mailing list