Announcing {arcgis}, an R package for ArcGIS Location Services

The R-ArcGIS Bridge team is excited to announce the release of {arcgis}, an open-source meta-package that facilitates interacting with ArcGIS location services from R. Now, ArcGIS users can access, modify, and publish web-based data from the comfort of R and their development environment of choice.

This new addition to the R-ArcGIS Bridge complements the existing {arcgisbinding} package – which “bridges” between R and ArcGIS Pro – by providing new ways for users to combine the powers of data science and statistical R packages with ArcGIS analytical, visualization, and data hosting capabilities.

{arcgis} overview

The {arcgis} meta-package provides a single point of access for users to install and load the associated packages, including:

Together, these packages enable data scientists, analysts, and developers to integrate the capabilities of R and ArcGIS for workflows and applications that use web-based services. Behind the scenes, {arcgis} achieves this by interacting with ArcGIS REST API endpoints.

With {arcgis}, users can:

Let’s take a look at a simple example of how {arcgis} can serve as a bridge between R and ArcGIS location services:

Get started by reading data from a public ArcGIS Online feature service into R

With {arcgis}, you can read data from ArcGIS web services including feature services, image services, and map services. In this simple example, you can use R to access attributes and geometries from a public ArcGIS Online feature service.

First, find an item of interest from the ArcGIS Living Atlas of the World. In this case, let’s use National Park Service Trails. You will need the URL in the bottom right corner of the page:

This URL is the REST endpoint for the National Park Service Trails FeatureServer. {arcgis} performs requests against such endpoints to return metadata, associated layers, and feature data.

In your R development environment of choice, run the following code to install (if needed) and load the package:

install.packages('arcgis') library('arcgis')

Now assign the URL to an object, furl, and use arc_open() to retrieve the metadata for the National Park Service Trails FeatureServer:


This FeatureServer just contains one layer. You can access that layer by its ID (0) using get_layer():


The NPS_Trails FeatureLayer allows query operations, giving you access to the underlying data. Because it is a best practice to only read in the data you need, consider limiting the fields returned and/or filtering using a SQL query.

Start by viewing the fields and selecting a relevant subset:


You can also construct a SQL query to filter the park name field (UNITNAME) to only return trails in Zion National Park:


Now use these objects to load a subset of the feature layer’s trail data:


This returns an sf object containing the Zion National Park trail features. You can use plot(ziontrails['TRLSURFACE']) to view the spatial features, symbolized by trail surface type. From here you can conduct analysis, build apps, or create visualizations in R!

A plot of the Zion trail features symbolized by trail surface type

About the authors

Martha Bass

Martha Bass is a Product Engineer on the Spatial Statistics team at Esri.


Nick Giner is a Product Manager for Spatial Analysis and Data Science. Prior to joining Esri in 2014, he completed Bachelor’s and PhD degrees in Geography from Penn State University and Clark University, respectively. In his spare time, he likes to play guitar, golf, cook, cut the grass, and read/watch shows about history.


Article Discussion:

Notify of
1 Comment
Inline Feedbacks
View all comments

Next Article

Generative AI in Urban Planning

Read this article