Every functions carries three boolean parameters that allow better utilization of these functions in R pipelines and reports. These are .complete_output, .quiet and .messages. The default setting of these variables is such that the calls are as silent as possible and create pretty much no output in R console at all.

Session setup

To avoid the situation where you have a lot of calls to qgis functions and you want them all to behave in the same non-standard way (i.e. you would prefer that the functions should be more talkative) you can set the parameters as R options. The options are: options(qgis.quiet = TRUE), options(qgis.messages = FALSE) and options(qgis.complete_output = TRUE). The values of these options are used as inputs for functions if these options exist, otherwise default values are used.

Examples setup

## Linking to GEOS 3.10.2, GDAL 3.4.1, PROJ 8.2.1; sf_use_s2() is TRUE
nc <- st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)

Parameter .quiet

Parameter .quiet (default values is TRUE) is the same as in qgisprocess::qgis_run_algorithm() only in qgis the functions are silent by default while in qgisprocess they are talkative.

Examples

Default values is TRUE and the output is silent.

buffered <- qgis::qgis_buffer(INPUT = nc, 
                              DISTANCE = 0.5, 
                              END_CAP_STYLE = "Flat", 
                              .quiet = TRUE) %>% 
  st_as_sf()
## Attempting to load the package cache ... 
## Standard error message from 'qgis_process':
## QStandardPaths: runtime directory '/tmp' is not owned by UID 1001, but a directory permissions 0777 owned by UID 0 GID 0
## 
## 
## Success!

With value set to FALSE the function tells you about the parameters and qgis_process call.

buffered <- qgis::qgis_buffer(INPUT = nc, 
                              DISTANCE = 0.5, 
                              END_CAP_STYLE = "Flat", 
                              .quiet = FALSE) %>% 
  st_as_sf()
## JSON input ----
## {
##   "inputs": {
##     "INPUT": "/tmp/RtmplqXhfm/fileddabb994290/fileddab23bccbee.gpkg",
##     "DISTANCE": 0.5,
##     "END_CAP_STYLE": 1,
##     "JOIN_STYLE": 0,
##     "OUTPUT": "/tmp/RtmplqXhfm/fileddabb994290/fileddabc60c4db.gpkg"
##   }
## }
## 
## Running qgis_process --json --skip-loading-plugins run 'native:buffer' -

Parameter .messages

Parameter .messages (default value is FALSE) controls if messages produced by qgisprocess (such as information about parameters not being set etc.) should be outputed or not.

Examples

Default values is FALSE and the output is silent.

buffered <- qgis::qgis_buffer(INPUT = nc, 
                              DISTANCE = 0.5, 
                              END_CAP_STYLE = "Flat", 
                              .messages = FALSE) %>% 
  st_as_sf()

With value set to TRUE the function tells you about default parameters values that were not set in the call.

buffered <- qgis::qgis_buffer(INPUT = nc, 
                              DISTANCE = 0.5, 
                              END_CAP_STYLE = "Flat", 
                              .messages = TRUE) %>% 
  st_as_sf()
## Argument `SEGMENTS` is unspecified (using QGIS default value).
## Using `JOIN_STYLE = "Round"`
## Argument `MITER_LIMIT` is unspecified (using QGIS default value).
## Argument `DISSOLVE` is unspecified (using QGIS default value).
## Argument `SEPARATE_DISJOINT` is unspecified (using QGIS default value).
## Using `OUTPUT = qgis_tmp_vector()`
## QStandardPaths: runtime directory '/tmp' is not owned by UID 1001, but a directory permissions 0777 owned by UID 0 GID 0
## Using non-preferred coordinate operation between EPSG:4267 and EPSG:4326. Using +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=push +v_3 +step +proj=cart +ellps=clrk66 +step +proj=helmert +x=-10 +y=158 +z=187 +step +inv +proj=cart +ellps=WGS84 +step +proj=pop +v_3 +step +proj=unitconvert +xy_in=rad +xy_out=deg, preferred +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=ca_nrc_ntv2_0.tif +step +proj=unitconvert +xy_in=rad +xy_out=deg.

Parameter .complete_output

Parameter .complete_output(default values is TRUE) specifies whether whole QGIS process output should be returned or only first variable in it, which is usually the main output. In many QGIS functions it is also the only output, that there is.