mkiesner
mkiesner

Reputation: 695

Multiple Inputs/Outputs from Execute R Script

Assume I have an Execute R Script that calculates multiple variables, say X and Y. Is it possible to save X as a dataset ds_X and Y as a dataset ds_Y?

The problem is that there is only 1 output port available that needs to be mapped to a data.frame. Am I missing an option to add more output ports? Same problem for input ports. I may connect 2 of the "Enter Data Manually" modules to it, but what if I need 3? The current workaround is to put CSV files in a ZIP file and connect that. Are there easier solution?

Example of what i tried:

I tried adding ds_X and ds_Y to a list. The idea is to pass this list to multiple "Execute R Script" modules and use the required list elements there. Mapping a list to an output port does not seem to work though:

# Calculate lots of stuff - results are ds_X and ds_Y
ds_X <- mtcars
ds_Y <- cars
out <- list(ds_X, ds_Y)

maml.mapOutputPort("out")

results in an error:

Error: Mapped variable must be of class type data.frame at this time.

Upvotes: 0

Views: 794

Answers (1)

Related Questions