Updating R Scripts Dynamically to Generate Images

<< Click to Display Table of Contents >>

Current:  Advanced Analytics > Other Advanced Analytics 

Updating R Scripts Dynamically to Generate Images

Previous pageReturn to chapter overviewNext page

R language has a large number of drawing functions. The system provides an interface for R script drawing. Run R script at the background via js script to generate images. You can dynamically load the generated images via the image component. Yonghong Z-Suite currently supports three types of images: png format, jpg format and bmp format.

 

The operation steps are as follows:

1. Use RCalScript to define Scriptable objects. The method is as follows:

(1) draw(String script, String path, boolean refresh): Where, script refers to R script; path refers to the image path (including the name and suffix. Images are stored in bihome/image by default.); refresh refers to refresh or not. If yes, a new image is generated every time. If no, image is generate only in absence of image. In case of R script drawing failure, the foreground returns the reason for the error.

ML122

 

(2)run(String script):

Where script refers to R script. In case of R script drawing failure, the foreground returns the reason for the error.

ML123

 

2. After the mapping method is executed, corresponding image resources exist in the image save path. You only have to refresh and import the image resources to the "Attribute" dialog of the image component.

ML124