R.CopyCurrentPlotToOutputDocument

Prototypes

static void CopyCurrentPlotToOutputDocument()

static void CopyCurrentPlotToOutputDocument( int nGraphicType )

static void CopyCurrentPlotToOutputDocument( OutputDocument Doc )

Parameters

int nGraphicType
A predefined constant that specifies the type of graphic you want to copy into the output document. The valid values are GRAPHICTYPE_DIB, GRAPHICTYPE_WMF, and GRAPHICTYPE_EMF.

OutputDocument Doc
The LISTING output document into which you want the plot copied. If this parameter is null, IML Studio copies the plot to the default LISTING output document.

Remarks

This method copies a picture of the current R plot to the program's output document. The behavior of this method varies depending on the ODS destination the program's workspace is configured to use.

If the program's workspace is configured to use the ODS HTML destination, IML Studio appends a picture of the current R plot to the HTML output. The parameter nGraphicType controls the file format of the picture. Calling this method without specifying the parameter nGraphicType is equivalent to calling it with nGraphicType equal to GRAPHICTYPE_EMF.

If the program's workspace is configured to use the ODS LISTING destination, IML Studio copies the current R plot as a Windows Metafile (WMF) graphic to the LISTING output document specified by the parameter Doc. If the parameter Doc is null or is not specified, IML Studio copies the plot to the default LISTING output document. The parameter nGraphicType is ignored.

Example
submit / R;
df <- trees
win.graph( 5, 4, 12 )
plot( df$Girth, df$Height )
endsubmit;

R.CopyCurrentPlotToOutputDocument();

submit / R;
# assigning dev.off() to a variable prevents a message
ignore <- dev.off( dev.cur() )
endsubmit;
See Also

Graphics File Formats

OutputDocument.PasteGraphic