2 Outline Introduction Application Integration options What is R? Why should I use it?ApplicationPoint ClusteringIntegration optionsR versus RpyConclusions 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 UsedOver 60 CRAN sites across 30+ countriesIts FreeGNU GENERAL PUBLIC LICENSEBase is powerfulStatistics, Linear Algebra, Visualization , etc…Its extendible1800+ Contributed Extensionssplancs, 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 ProximityAttributes Values
6 Integration with ArcGIS Two (Three) Integration Options With ArcGISBoth require PythonBoth have pros and consESRI UC Plenary 2008predicting plant species in unknown areas
7 Integration: R Option Decouples R and Python Python R Retrieves and organize parameters from ArcGISConvert Data (Interchange)Shapefiles, netcdf, img etc….Spawns R given the *.r file with provided parametersRDoes the analysisPython ScriptArcGISR Script
8 Integration: RPy Option R and Python closely coupledRPy (RPy2)Python Interface to the R Programming LanguagePythonRetrieves and organize parameters from ArcGISRPy module is imported and R commands are executed within the Python script fileArcGISPython ScriptR Processing
9 Which One Should I Use? R Option Attractive to R Programmers “Out of Proc”: Spawning R on every executeUse Copy Features!!!selection setsProjections and other environment variablesYou must use an R library for handling shapefilesmaptools, shapefilesTwo files per script tool (*.py and *.r)
11 Which One Should I Use? Cont… RPy OptionFor more advanced users (Python and R knowledge)“In Process”Will be MUCH faster after the first callHonors selection setsA robust choice of database formatsWill honor environment settings (GP Functions)Only a single file associated with your script tool
12 RPy Option Code Snippet Source R LibrariesNumPy and R InterchangeCluster AnalysisCreate Output
13 Which One Should I Use? Cont… Wait… Why would I go with the R Option?Doesn’t have as many dependencies/layersRPyPython, 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 ArcGISManual fix in the portal tool documentationBoth 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 fieldsextendibleOpen-sourceCan be integrated with ArcGIS using PythonR versus RPy (RPy2)Pros and Cons
15 Future Directions RPy2 Web Portal: RTools Calling Python from R Could be expanded uponCalling Python from RLeveraging geoprocessing within the R environmentRSPython:
16 Links R RPy (Link to RPy2) Python NumPy RPy (Link to RPy2)PythonNumPy
17 Related SessionsDeveloping Python Scripts for Data Analysis Tips and TricksGeoprocessing Demo Theater – W, 5:00 – 6:00Spatial Statistics: Using Spatial StatisticsTH 1:30 – 2:45Regression Analysis for Spatial Data with ArcGIS 9.3TH 3:15 – 4:30
Your consent to our cookies if you continue to use this website.