rpygeo_build_env: Initialize ArcPy site-package in R

Description Usage Arguments Value Author(s) Examples

View source: R/rpygeo_reticulate.R

Description

Initialises the Python ArcPy site-package in R via the reticulate package. Addtionally environment settings and extensions are configured.

Usage

1
2
3
rpygeo_build_env(path = NULL, overwrite = TRUE, extensions = NULL,
  x64 = FALSE, pro = FALSE, arcgisAPI = FALSE, workspace = NULL,
  scratch_workspace = NULL)

Arguments

path

Full path to folder containing Python version which is linked to the ArcPy site-package. If left empty, the function looks for python.exe in the most likely location (C:/Python27/). It is also possible to provide a path to the ArcGIS API for Python here. In order to do so you need to provide the path to the python anaconda library were the arcgis package is installed. Additionally arcgisAPI must be set to true.

overwrite

If TRUE (default), existing ArcGIS datasets can be overwritten (does not work while using ArcGIS API for Python).

extensions

Optional character vector listing ArcGIS extension that should be enabled (does not work while using ArcGIS API for Python)

x64

Logical (default: FALSE). Determines if path search should look for 64 bit Python ArcPy version in default folder (C:/Python27)

pro

Logical (default: FALSE). If set to TRUE' rpygeo_build_env tries to find Python version to use in the default ArcGIS Pro location (C:/Program Files/ArcGIS/Pro/bin/Python/envs/arcgispro-py3/)

arcgisAPI

Logical (default: FALSE). Must be set to TRUE in order to use the ArcGIS API. This is the only option to work with the RPyGeo Package under a linux operation system.

workspace

Path of ArcGIS workspace in which to perform the geoprocessing (does not work while using ArcGIS API for Python).

scratch_workspace

Path to ArcGIS scratch workspace in which to store temporary files (does not work while using ArcGIS API for Python). If NULL a folder named scratch is created inside the workspace folder or on the same directory level as the workspace file geodatabase.

Value

Returns ArcPy or ArcGIS modules in R

Author(s)

Fabian Polakowski, Marc Becker

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
# Load ArcPy side-package of ArcGIS Pro with 3D and Spatial Analysis extension.
# Set environment setting 'overwrite' to TRUE.
# Note that no path parameter is necessary because Python is located in the
# default location.
arcpy <- rpygeo_build_env(overwrite = TRUE,
                          extensions = c("3d", "Spatial"),
                          pro = TRUE)
## End(Not run)

# Load the ArcPy module when your Python version is located in a different
# folder

fapola/RPyGeo documentation built on April 11, 2020, 3:09 p.m.