How to output the result table from R node as a R node output spreadsheet for downstream analysis?

How to output the result table from R node as a R node output spreadsheet for downstream analysis?

book

Article ID: KB0073856

calendar_today

Updated On:

Products Versions
Spotfire Statistica 13.3 and later

Description

Use Case:

I am able to integrate R language with Statistica and run the R code in the Statistica R node.
But the R node is just outputting the result as a report document in the "Reporting Document" node, and I am unable to re-use the result spreadsheet for further analysis. 
Is it possible to output the results as a node of data spreadsheet and link with other analysis nodes for further downstream analysis?

Issue/Introduction

How to output the result table from R node as a R node output spreadsheet for downstream analysis?

Environment

Windows

Resolution

The answer is Yes. 

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:
  • AsDownstream - marks a spreadsheet being routed from R to be sent as a downstream document to the node instead of the Reporting Documents workbook
  • RetainInReport - when the AsDownstream parameter is set to TRUE, this parameter places a copy of the spreadsheet in the Reporting Documents collection.
For example, 

1. This R code "RouteOutput(simpleDF, 'My simpleDF-rd')" will only output the result table to be a reporting document in the "Reporting Document" node, and cannot be linked to other nodes for further downstream analysis. 

2. To set the interested output from R node as a downstream spreadsheet for further analysis, you can use "RouteOutput" function with "AsDownstream" being TRUE. 
For example, R code:
RouteOutput(simpleDF, 'simpleDF-dd', 'simpleDF-dd Header', AsDownstream = TRUE)

User-added image

This code will lead to an output spreadsheet document icon located at the bottom right corner of the R node.
This output spreadsheet from R node can link to other downstream analysis nodes and serve as input data table for further analysis.