The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
Getting started with {arcpy}
in R is easy. If you're using ArcGIS Pro, you'll first need to create a Conda environment that will link to your ArcGIS Pro install. If you're not familiar with Conda or the reticulate
package, check the vignettes Calling Python from R and Python Version Configuration.
For example, here's how you would create a Conda environment to link to an ArcGIS Pro 3.1 install.
library(arcpy)
install_arcpy(version = "3.1")
If you don't specify the python version, the package will use the latest compatible Python version based on what is reported in the arcpy module build. By default, the package creates a new environment named "r-arcpy", but this can be overridden.
{arcpy}
automatically provides a reticulate
module object called arcpy
. This object provides the interface to ArcGIS.
arcpy
## Module(arcpy)
arcpy$GetInstallInfo()$ProductName
## [1] "ArcGISPro"
Once you are connected to your ArcGIS installation, using arcpy
functions and classes is as seamless as using any other Python module via reticulate
.
# get and set the arcpy environment
arcpy$env$workspace = tempdir()
arcpy$env$workspace
## [1] "C:\\Temp\\1\\RtmpGWDuu8"
{arcpy}
also re-exports reticulate's py_help
function so that you can access the arcpy
documentation.
# get help on arcpy functions
py_help(arcpy$Exists)
Happy scripting!
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.