Learn R Programming

RQGIS (version 0.1.0)

set_env: Retrieve the environment settings to run QGIS from within R

Description

set_env tries to find all the paths necessary to run QGIS from within R.

Usage

set_env(root = NULL, ltr = TRUE)

Arguments

root
Root path to the QGIS-installation. If you do not specify function parameter root, the function looks for qgis.bat on your C: drive under Windows. If you are on a Mac, it looks for QGIS.app under "Applications" and "/usr/local/Cellar/". On Linux, set_env assumes that your root path is "/usr".
ltr
If TRUE, set_env will use the long term release of QGIS, if available (only for Windows).

Value

The function returns a list containing all the path necessary to run QGIS from within R. This is the root path, the QGIS prefix path and the path to the Python plugins.

Examples

Run this code
## Not run: 
# # Letting set_env look for the QGIS installation might take a while depending
# # on how full your C: drive is (Windows)
# set_env()
# # It is much faster (0 sec) to explicitly state the root path to the QGIS 
# # installation on your machine
# set_env("C:/OSGEO4~1")  # Windows example
# ## End(Not run)

Run the code above in your browser using DataLab