Basic Architecture and Features of R Support in Statistica

R support in Statistica was designed to create an integrated Statistica-R platform that enables users to run R programs or scripts directly inside Statistica so that they can take full advantage of the specialized capabilities available in R.

The R Integration environment in Statistica was specifically designed for the following enhancements:

  • Enable users to run R scripts as is, and retrieve the results into Statistica reports
    • all R console output is copied into the report; R commands are highlighted
    • plots generated by the script are automatically embedded in the report as scalable images
    • these plots are also replicated as Statistica Graphs (scalable “metafile” images are placed inside these graphs), thus enabling annotation using powerful graphical facilities in Statistica; the graphs can then be printed or exported into a variety of image formats
    • the reports can be edited, printed, and saved as PDF files
  • Provide R language extensions functions for R scripts run from the Statistica environment that:
    • transfer data from Statistica Spreadsheets into R data frames
    • extract tabular data from R variables into Statistica Spreadsheets; these “results” spreadsheets (as well as all graphs produced by the script) are returned according to Output Manager settings (“routed”), e.g., placed into Statistica Workbooks
  • Execute R scripts as native Macros from within Statistica Visual Basic (SVB) programs
    • scripts can be parameterized with a Collection of objects (numbers, strings, arrays, additional R code or overridden R functions, spreadsheets) that are mapped to R variables accessible to the script; this approach provides fine-grained control over scripts’ behavior in repeated runs or when used as the backend for custom Statistica modules.
    • by default, all script output is routed by Statistica Output Manager; scripts may also be executed using a method that instead returns its output as a Document Collection, giving developers an easy way to extract specific analysis results that could be used for further processing, e.g., as input data for further analyses in Statistica or in R, or for graphing.
    • R Node is integrated into Statistica which makes specialized R functionality available as reusable analysis templates to users who are not familiar with the R language.

Taken together, these enhancements not only enable users to run R scripts directly in the Statistica desktop environment, but also provide a way to embed specialized R functionality into custom interactive analysis modules, Workspace nodes, analysis configurations, or to offload such scripts to Statistica Server for server-side processing.

Developing and debugging R scripts

Statistica does not supply a complete R development and debugging environment. The console application and tools supplied with standard R installation perform those functions very well, and are already familiar to R users and developers.