Retrieving Results

Console Session

The minimal output produced during execution of an R script is a Statistica Workbook that represents an R console session, including highlighted commands and any output generated by the R environment. Such a report will be produced even if the script is empty. The contents of this report can be edited and manipulated in the same way that you would edit any other Statistica report.

Graphical Output

All plots created during an R session are automatically transferred into the Statistica environment as Windows Metafiles (vector graphics format), which means they can be resized without loss of quality.

These plots are placed into the R console session report, creating a natural flat report of the R session with embedded plots tied to the graphics commands.

Moreover, the plots are also replicated as Statistica Graphs that become a part of the R script output. The metafile images are embedded into graph objects as locked “background” this enables users to annotate R plots in Statistica using a familiar point-and-click interface with a set of text and drawing objects (such as lines and arrows, rectangles and ellipses, polygons and pattern/color fill areas, etc.). And since these annotations are anchored to relative positions in the plot area, they will remain correctly “attached” to the plot if the graph is resized.

Therefore, these graphs can be flexibly designed and further enhanced using Statistica graphics tools, saved in other formats (e.g., JPG or GIF), or printed (e.g., to PDF files).

The individual R plot components (the structural elements of the plot) are not accessible for manipulation in Statistica Graphs, and hence, the rich capabilities of Statistica for creating and then further editing graphs (scaling, point markers, fit lines, etc.) are not available. However, integration between R and Statistica provides opportunities to extract data from R and then render important graphs inside the Statistica environment (by writing Statistica Visual Basic macros that will execute R scripts, extract results, and then post-process those results as necessary; this will be illustrated later).