Learn R Programming

CORElearn (version 1.57.3)

preparePlot: Prepare graphics device

Description

Based on provided fileName opens and sets appropriate graphical device: pdf, postscript, interactive graphical window, or (only on windows) windows metafile,.

Usage

preparePlot(fileName="Rplot",...)

Value

A plot device is opened and nothing is returned to the R interpreter.

Arguments

fileName

Name of the file to store the output to.

...

Further parameters passed to device.

Author

Marko Robnik-Sikonja

Details

The function opens the graphical output device based on fileName extension. The extensions .pdf, .ps, .jpg, .bmp, .tif, .png, .tiff or none select pdf, postscript, jpeg, bmp, tiff,png, bitmap or a default (interactive) graphical device.

On Windows also .emf extension is supported which opens win.metafile and creates vector graphics in windows enhanced metafile format.

The extension .tiff opens bitmap device which produces bitmap via postscript device. Therefore it requires Ghostscript to be installed and on the executable path.

Some sensible default values are passed to created devices, but further options can be passed via ....

See Also

CORElearn, plot.ordEval, pdf, postscript, jpeg, bmp, tiff, png, Devices

Examples

Run this code
   # prepare a data set
    dat <- ordDataGen(200)
    # evaluate ordered features with ordEval
    oe <- ordEval(class ~ ., dat, ordEvalNoRandomNormalizers=200)
    
    # the folowing line if uncommented will create a separate 
    # postscript file with given filename for each attribute   
    # preparePlot("myGraph%03d.ps") 
    
    plot(oe)
    dev.off()

Run the code above in your browser using DataLab