get_args_man retrieves automatically function arguments and respective default values for a given QGIS geoalgorithm.

get_args_man(alg = "", options = TRUE, qgis_env = set_env())

Arguments

alg

The name of the algorithm for which one wishes to retrieve arguments and default values.

options

Sometimes one can choose between various options for a function argument. Setting option to TRUE, the default, will automatically assume one wishes to use the first option (QGIS GUI behavior).

qgis_env

Environment containing all the paths to run the QGIS API. For more information, refer to set_env().

Value

The function returns a list whose names correspond to the function arguments one needs to specify. The list elements correspond to the argument specifications. The specified function arguments can serve as input for run_qgis()'s params argument. Please note that although get_args_man tries to retrieve default values, one still needs to specify some function arguments manually such as the input and the output layer.

Details

get_args_man basically mimics the behavior of the QGIS GUI. That means, for a given GIS algorithm, it captures automatically all arguments and default values. In the case that a function argument has several options, one can indicate to use the first option (see also get_options()), which is the QGIS GUI default behavior.

Note

Please note that some default values can only be set after the user's input. For instance, the GRASS region extent will be determined automatically by run_qgis() if left blank.

Examples

# NOT RUN {
get_args_man(alg = "qgis:addfieldtoattributestable")
# and using the option argument
get_args_man(alg = "qgis:addfieldtoattributestable", options = TRUE)
# }