get the unique elements in the vectors
for each of this element: get the average order across
the different vectors
put variable, if present as second to last element
put variableGroup, if present, as last element
order the unique elements based on the extracted order