Hi want to set some roles to customer roles. But it seems RM only allow one column for each role except for the regular role `attribute`.
Here's an exmaple. I generate the follow table:

and I set att1, att2, att3 to have role == 'something', and only att3 shows at the output:

I used `execute R` to set the role by changing the metadata. Inside `execute R` the metadata and column count is correct (printed in log)
metaData before changing role:
Oct 27, 2016 3:49:16 PM INFO: data col_name role type
Oct 27, 2016 3:49:16 PM INFO: 1 table_in att1 attribute real
Oct 27, 2016 3:49:16 PM INFO: 2 table_in att2 attribute real
Oct 27, 2016 3:49:16 PM INFO: 3 table_in att3 attribute real
Oct 27, 2016 3:49:16 PM INFO: 4 table_in att4 attribute real
Oct 27, 2016 3:49:16 PM INFO: 5 table_in att5 attribute real
Oct 27, 2016 3:49:16 PM INFO: 6 table_in label label real
How many columns:
Oct 27, 2016 3:49:16 PM INFO: [1] 6
metaData after changing role:
Oct 27, 2016 3:49:16 PM INFO: data col_name role type
Oct 27, 2016 3:49:16 PM INFO: 1 table_in att1 something real
Oct 27, 2016 3:49:16 PM INFO: 2 table_in att2 something real
Oct 27, 2016 3:49:16 PM INFO: 3 table_in att3 something real
Oct 27, 2016 3:49:16 PM INFO: 4 table_in att4 attribute real
Oct 27, 2016 3:49:16 PM INFO: 5 table_in att5 attribute real
Oct 27, 2016 3:49:16 PM INFO: 6 table_in label label real
How many columns:
Oct 27, 2016 3:49:16 PM INFO: [1] 6
Could somebody help please? Thanks--
Code is here:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="6.4.000">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="6.0.002" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" breakpoints="after" class="generate_data" compatibility="6.4.000" expanded="true" height="60" name="Generate Data" width="90" x="45" y="30">
<parameter key="number_examples" value="20"/>
</operator>
<operator activated="true" class="r_scripting:execute_r" compatibility="6.4.000" expanded="true" height="76" name="Execute R 1" width="90" x="246" y="30">
<parameter key="script" value="library(reshape2) organize_metadata = function(metaData){ meta = melt(metaData) names(meta) = c('value', 'variable', 'col_name', 'data') meta = dcast(meta, formula = data + col_name ~ variable) meta } rm_main = function(table_in){ print(organize_metadata(metaData)) print(ncol(table_in)) metaData$table_in[[1]]$role <<- 'something' metaData$table_in[[2]]$role <<- 'something' metaData$table_in[[3]]$role <<- 'something' print(organize_metadata(metaData)) print(ncol(table_in)) table_in } "/>
</operator>
<connect from_op="Generate Data" from_port="output" to_op="Execute R 1" to_port="input 1"/>
<connect from_op="Execute R 1" from_port="output 1" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>