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

Description Usage Arguments Value Author(s) Examples

View source: R/processing.R

Description

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

Usage

1
set_env(root = NULL, new = FALSE, dev = FALSE, ...)

Arguments

root

Root path to the QGIS-installation. If left empty, the function looks for qgis.bat first in the most likely locations (C:/OSGEO4~1, C:/OSGEO4~2), and secondly on the C: drive under Windows. On a Mac, it looks for QGIS.app under "Applications" and "/usr/local/Cellar/". On Linux, set_env assumes that the root path is "/usr".

new

When called for the first time in an R session, set_env caches its output. Setting new to TRUE resets the cache when calling set_env again. Otherwise, the cached output will be loaded back into R even if you used new values for function arguments root and/or dev.

dev

If set to TRUE, set_env will use the development version of QGIS (if available). Since RQGIS so far does not support QGIS 3 (developer version), setting dev to TRUE will result in an error message under Windows.

...

Currently not in use.

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.

Author(s)

Jannes Muenchow, Patrick Schratz

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# Letting set_env look for the QGIS installation might take a while depending
# on how full the C: drive is (Windows)
set_env()
# It is much faster (0 sec) to explicitly state the root path to the QGIS
# installation
set_env("C:/OSGEO4~1")  # Windows example

## End(Not run)

jannes-m/RQGIS documentation built on April 19, 2020, 11:41 p.m.