Presentation is loading. Please wait.

Presentation is loading. Please wait.

Extending ArcGIS with R

Similar presentations


Presentation on theme: "Extending ArcGIS with R"— Presentation transcript:

1 Extending ArcGIS with R
Mark Janikas, PhD

2 Outline Introduction Application Integration options
What is R? Why should I use it? Application Point Clustering Integration options R versus Rpy Conclusions and Future Directions

3 What is R? Why should I use it?
R (The R Project for Statistical Computing) is an open-source data analysis package. (GNU S) Widely Used Over 60 CRAN sites across 30+ countries Its Free GNU GENERAL PUBLIC LICENSE Base is powerful Statistics, Linear Algebra, Visualization , etc… Its extendible 1800+ Contributed Extensions splancs, spatstat, spdep, rgdal, maptools, shapefiles

4 R Point Clustering Tools for ArcGIS
Resource Center (Code Gallery) Contains two tools… that do the same thing!

5 Application: Point Clustering
Cluster a given a set of point locations: Spatial Proximity Attributes Values

6 Integration with ArcGIS
Two (Three) Integration Options With ArcGIS Both require Python Both have pros and cons ESRI UC Plenary 2008 predicting plant species in unknown areas

7 Integration: R Option Decouples R and Python Python R
Retrieves and organize parameters from ArcGIS Convert Data (Interchange) Shapefiles, netcdf, img etc…. Spawns R given the *.r file with provided parameters R Does the analysis Python Script ArcGIS R Script

8 Integration: RPy Option
R and Python closely coupled RPy (RPy2) Python Interface to the R Programming Language Python Retrieves and organize parameters from ArcGIS RPy module is imported and R commands are executed within the Python script file ArcGIS Python Script R Processing

9 Which One Should I Use? R Option Attractive to R Programmers
“Out of Proc”: Spawning R on every execute Use Copy Features!!! selection sets Projections and other environment variables You must use an R library for handling shapefiles maptools, shapefiles Two files per script tool (*.py and *.r)

10 R Option Code Snippet

11 Which One Should I Use? Cont…
RPy Option For more advanced users (Python and R knowledge) “In Process” Will be MUCH faster after the first call Honors selection sets A robust choice of database formats Will honor environment settings (GP Functions) Only a single file associated with your script tool

12 RPy Option Code Snippet
Source R Libraries NumPy and R Interchange Cluster Analysis Create Output

13 Which One Should I Use? Cont…
Wait… Why would I go with the R Option? Doesn’t have as many dependencies/layers RPy Python, R, and RPy builds have to play nice! You must know Python, some R and now RPy. Currently there is an open bug in RPy that must be fixed in order to run in the “In Process” mode in ArcGIS Manual fix in the portal tool documentation Both methods require the editing of Environment Variables in order to run properly

14 Conclusions R Can be integrated with ArcGIS using Python
contains “cutting edge” data analysis techniques from a wide body of academic and applied fields extendible Open-source Can be integrated with ArcGIS using Python R versus RPy (RPy2) Pros and Cons

15 Future Directions RPy2 Web Portal: RTools Calling Python from R
Could be expanded upon Calling Python from R Leveraging geoprocessing within the R environment RSPython:

16 Links R RPy (Link to RPy2) Python NumPy
RPy (Link to RPy2) Python NumPy

17 Related Sessions Developing Python Scripts for Data Analysis Tips and Tricks Geoprocessing Demo Theater – W, 5:00 – 6:00 Spatial Statistics: Using Spatial Statistics TH 1:30 – 2:45 Regression Analysis for Spatial Data with ArcGIS 9.3 TH 3:15 – 4:30


Download ppt "Extending ArcGIS with R"

Similar presentations


Ads by Google