r-arcgis-tutorials

Esri Canada

Introduction to R Scripting with ArcGIS

Tutorials for ArcGIS Pro 2.2 / ArcGIS Desktop 10.6.1


Overview

This package consists of four tutorials that deal with integrating the statistical programming language R with ArcGIS for Desktop. Several concepts are covered which include configuring ArcGIS with R, writing basic R scripts, writing R scripts that work with ArcGIS data, and constructing R Tools for use within ArcGIS Pro or ArcGIS Desktop. It is recommended that the tutorials are completed in squential order.

Each of the four tutorials (as well as a version of this document), can viewed directly from your Web browser by following the links below. However, you must obtain a complete copy of the tutorial files by downloading the latest release (or by cloning the tutorial repository on GitHub) if you wish to follow the tutorials interactively using ArcGIS and R softare, along with pre-configured sample data.

  1. Getting Started with the R-ArcGIS Bridge:
    • Installing and setting up R and RStudio
    • Installing the R-ArcGIS Bridge
    • Installing and loading third-party R packages
    • Extract sample data
    • Running basic R script tools from an ArcGIS toolbox

  2. R Scripting Basics (PDF):
    • Using R Integrated Development Environments (RStudio Desktop)
    • Writing expressions and executing commands in R
    • Working with basic objects and data types in R
    • Importing and subsetting data in R

      Note: The R Scripting Basics tutorial can be considered optional by anyone that is already well-versed in the R programming language, and familiar with RStudio Desktop or an equivalent IDE for developing R code

  3. R-ArcGIS Scripting (PDF):
    • Reading/writing ArcGIS datasets using the arcgisbinding package
    • Working with ArcGIS datasets in R
    • Manipulating and analyzing spatial data in R

  4. Building an R Script Tool:
    • Creating and debugging R scripts designed for use as script tools by ArcGIS applications
    • Creating and configuring script tools in an ArcGIS toolbox to execute R code
    • Integrating R script tools into Model Builder workspaces


© 2018 Esri Canada. All rights reserved. Trademarks provided under license from Environmental Systems Research Institute Inc. Other product and company names mentioned herein may be trademarks or registered trademarks of their respective owners. Errors and omissions excepted. This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

CC-BY-NC-SA-4.0