Example TERR / RinR / RGraph() data function that returns a column of R qqnorm() graphs in a Spotfire data table
book
Article ID: KB0080343
calendar_today
Updated On:
Products
Versions
Spotfire Analyst
7.5 and later
Description
Example TERR / RinR / RGraph() data function that returns a column of R qqnorm() graphs in a Spotfire data table.
Issue/Introduction
Example TERR / RinR / RGraph() data function that returns a column of R qqnorm() graphs in a Spotfire data table.
Environment
All supported environments.
Resolution
The example TERR / RinR / RGraph() data function in the attached DXP file (Filename: "qqnormGraphsInDataTableColumn.dxp") returns a column of R qqnorm() graphs in a Spotfire data table and displays the graphs in a Table visualization.
The DXP file's "qqnormGraphs" data function expects the "FuelFrame" data table as the 'FuelFrame' input data frame for its TERR script and returns the script's output 'qqnormGraphsDF' data frame as its "qqnormGraphsTable" output data table.
if( ! file.exists( PathToOpenSourceR ) ) { stop( paste( "The specified path to open-source R (", PathToOpenSourceR, "does not exist in this environment. Please specify a valid path, including the name of the executable, such as 'R.exe', in the data function's TERR script." ) ) }
Information on R graphics functions used in the example TERR script's call to RinR::RGraph() can be found in the help files that are opened by the following open-source R commands:
?qqnorm ?qqline ?par
Note that R graphics are not implemented in TERR at this point, so the following command would not create a graph in TERR:
qqnorm( Sdatasets::fuel.frame$Mileage )
Disclaimer:The code in this article is only a sample to be used as a reference. It is not intended to be used "As Is" in a Production environment. Always test in a Development environment. Make modifications to the code in accordance with your implementation specifications that best suit your business requirements. Refer to the reference(s) cited in this article for usage of the functions and methods used in the code.
Attachments
Example TERR / RinR / RGraph() data function that returns a column of R qqnorm() graphs in a Spotfire data table
get_app