Executes an R script that generates a matrix from the given data. Table inputs are read into data.frame/file variables of the same name and then the given script is called. Table and var inputs will have defaults of NULL but they will point to the input files/folders if bound to somewhere. The script should produce a data.frame called table.out that will be saved to the output port.
The tables can be given in an array. They are read in to a list variable called array. The elements of the list are data.frames read from the CSV files in the array. The names of the elements of the list are the keys of the corresbonding elements in the array input. To output an array create a variable array.out containing a list of data.frames. The names of the elements of the list will we used as keys for the array. The filenames will be of the form "key.csv", where key is the name of the element in the list. If asConnection is true, the list elements of array are connections (class file) to the input array elements.
This component may also generate a LaTeX document. This is especially useful if you want to plot some figures. Output folder of the document is document.dir and the actual text can be written by assigning it to document.out that is a character vector. The unique name of the REvaluate component instance is available as instance.name.
Arbitrary outputs can be stored into optOut1, optOut2, and optOut3 strings and they will be written into the corresponding output files. You may also write directly into these files (just like in standard Anduril components) but then you should remove the corresponding variable declarations (for example rm(optOut1)) in order to prevent the host from overwriting your output.
When working e.g. with large input files it might be convenient to open a connection to the input files instead of reading all the input files into memory as data.frame objects.
Version | 2.2 |
---|---|
Bundle | tools |
Categories | External Latex Network Control |
Specialties | generic |
Authors | Marko Laakso (Marko.Laakso@Helsinki.FI), Erkka Valo (erkka.valo@helsinki.fi) |
Issue tracker | View/Report issues |
Requires | R |
Source files | component.xml REvaluate.r |
Usage | Example with default values |
Name | Type | Mandatory | Description |
---|---|---|---|
script | RSource | Mandatory | Data transformation |
table1 | CSV | Optional | Data matrix 1 (data.frame/file table1) |
table2 | CSV | Optional | Data matrix 2 (data.frame/file table2) |
table3 | CSV | Optional | Data matrix 3 (data.frame/file table3) |
table4 | CSV | Optional | Data matrix 4 (data.frame/file table4) |
table5 | CSV | Optional | Data matrix 5 (data.frame/file table5) |
var1 | INa or Array<INa> (generic) | Optional | Generic input that may be used for folders, arrays and binaries |
var2 | INb or Array<INb> (generic) | Optional | Generic input that may be used for folders, arrays and binaries |
var3 | INc or Array<INc> (generic) | Optional | Generic input that may be used for folders, arrays and binaries |
inArray | Array<CSV> | Optional | Input array (list of data.frames array) |
Name | Type | Description |
---|---|---|
table | CSV | Result matrix |
outArray | Array<CSV> | Result array |
optOut1 | OUTa or Array<OUTa> (generic) | An optional output that can be used for custom data types. By default this file is empty. |
optOut2 | OUTb or Array<OUTb> (generic) | An optional output that can be used for custom data types. By default this file is empty. |
optOut3 | OUTc or Array<OUTc> (generic) | An optional output that can be used for custom data types. By default this file is empty. |
document | Latex | An optional output document, which may include some figures. |
Name | Type | Default | Description |
---|---|---|---|
asConnection | boolean | false | If true, assign file connections (class file) to the inputs to variables of the same name. This is useful e.g. if you want to read large data files row by row. |
param1 | string | "" | Value of this parameter will be assigned to param1 variable |
param10 | string | "" | Value of this parameter will be assigned to param10 variable |
param2 | string | "" | Value of this parameter will be assigned to param2 variable |
param3 | string | "" | Value of this parameter will be assigned to param3 variable |
param4 | string | "" | Value of this parameter will be assigned to param4 variable |
param5 | string | "" | Value of this parameter will be assigned to param5 variable |
param6 | string | "" | Value of this parameter will be assigned to param6 variable |
param7 | string | "" | Value of this parameter will be assigned to param7 variable |
param8 | string | "" | Value of this parameter will be assigned to param8 variable |
param9 | string | "" | Value of this parameter will be assigned to param9 variable |
Test case | Parameters▼ | IN script |
IN table1 |
IN table2 |
IN table3 |
IN table4 |
IN table5 |
IN var1 |
IN var2 |
IN var3 |
IN inArray |
OUT table |
OUT outArray |
OUT optOut1 |
OUT optOut2 |
OUT optOut3 |
OUT document |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
case1 | (missing) | script | table1 | table2 | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | table | (missing) | optOut1 | optOut2 | optOut3 | document |
case2_properties | (missing) | script | table1 | table2 | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | table | (missing) | (missing) | (missing) | (missing) | (missing) |
case3_document | properties | script | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | table | (missing) | optOut1 | optOut2 | optOut3 | document |
param1 = v1, |
|||||||||||||||||
case4_as_connection | properties | script | table1 | table2 | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | table | (missing) | (missing) | (missing) | (missing) | (missing) |
asConnection = true, |
|||||||||||||||||
case5_folder | (missing) | script | (missing) | (missing) | (missing) | (missing) | (missing) | var1 | (missing) | (missing) | (missing) | table | (missing) | (missing) | (missing) | (missing) | (missing) |
case6_array | (missing) | script | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | inArray | (missing) | outArray | (missing) | (missing) | (missing) | (missing) |
case7_array_as_connection | properties | script | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | inArray | (missing) | outArray | (missing) | (missing) | (missing) | (missing) |
asConnection=true |