RPGM 2.0 Docs

RPGM R functions

rpgm.pgmFilePath(filename)

Returns the full path to a temporary folder containing all the files in your .pgm program. Can also serve as a temporary folder for operations and temporary files like images or R data.

  • filename is the filename for which the full path will be returned

Example:

# Source a shipped R file
source(rpgm.pgmFilePath("includes/stats_functions.R"));

# Show an image in the next GUI (by a R expression "img_path" in builder)
img_path <- rpgm.pgmFilePath("images/company.png");
png(filename=img_path);
plot(faithful);
dev.off();

rpgm.setNextSequence(step)

Manually sets the next sequence to execute. step is a step object created with rpgm.step.

rpgm.step(file, step)

Creates a variable representing a step from a sequence file. It is needed in a lot of gui and report functions.

s <- rpgm.step("main.pseq", "gui_input");
gui.showError(s, "my_field", "This field is not correct");