[Qgis-developer] Multiple Fields in R-Processing

matteo matteo.ghetta at gmail.com
Fri Sep 30 01:19:41 PDT 2016


Hi Victor,

thanks for your answer..

> The value of the multiple flieds is a string with field names
> separated by semicolons
> 
> so, to get a list of them:
> 
> fields = multiple_fields.split(";")
> 
> Not sure this is what you need...maybe I am not understanding the question....

actually not :)


a small example is.. I have a vector layer with some fields and I want
to perform normality test on some of the fields..

so I have 2 options:

1. create many ##field1 = Field Layer and give to some of them the label
optional because the user doesn't know how many fields would be in input..

2. use ##fields = multiple Field Layer that, as you said, throws out a
list with all the field names separated by ";" and loop on that columns

now the problem with my R script is that I cannot get the variable with
the selected fields, for example:

##Vector processing=group
##Layer=vector
##fields = multiple Field Layer

aa = fields

>aa

even to do in this way (so just printing the entire string of all the
field names) throws the error:

Error: unexpected symbol in " multiple Field"


I try your suggestion (f = fields.split(";")) but I get the same error
of above again.

For sure I'm missing something, but I really don't understand what..

Thanks again Victor!

Cheers

Matteo


More information about the Qgis-developer mailing list