Custom R Workspace Nodes
Custom R nodes can be produced by using two files: a .dmi file and an R script file. The R script file must be referred to in the .dmi file.
See RNodeTemplate.dmi and RNodeTemplate.r in the DataMiner folder in Statistica application folder for reference (C/Program Files/Statistica>Statistica */DataMiner).
Custom icon files can be used for nodes by specifying them in the .dmi file.
To import R nodes into the node browser, first, import the RNodeTemplate.dmi file.
Procedure
- Open the Node Browser.
- Click the down arrow on the toolbar,
-
Select
Import New Node. A standard
Open dialog box displays, from which you can locate and open the .dmi file.
After the .dmi file is imported, it can be instantiated into the workspace like all other nodes. - Add Parameters to the node by the Edit Parameters dialog box (as with SVB nodes) or by modifying the .dmi file.
Result
All parameters are made available in the R workspace automatically with appropriate data types.
Similar to SVB style nodes, the node's R script can be modified by right-clicking the node and selecting Edit Code. A window displays to edit the R code associated with the node instead of SVB code.
The R node is capable of handling zero, one, or more input data sets. In the context of R nodes, the ActiveDataSet extension returns: a list of data frames if there are more than one input spreadsheets; a data frame if there is one input spreadsheet; and NULL if there are none. Any variable selections made on the input spreadsheets are made available as attributes on the data frames.
The R node is capable of producing zero, one or more downstream documents. In the context of R nodes, the RouteOutput extension supports two extra parameters: