6.1.2 APIs for Embedded R Execution

Oracle R Enterprise provides R and SQL application programming interfaces for embedded R execution. The following table lists the R functions and the equivalent SQL functions and procedures for embedded R execution and R script repository management. The function f refers to a named R function or an R function defined in a script in the Oracle R Enterprise R script repository.

Table 6-1 R and SQL APIs for Embedded R Execution

R API SQL API Description

ore.doEval

rqEval

Executes f with no automatic transfer of data.

ore.tableApply

rqTableEval

Executes f by passing all rows of the provided input ore.frame as the first argument of f. Provides the first argument of f as a data.frame.

ore.groupApply

rqGroupEval

This function must be explicitly defined by the user.

Executes f by partitioning data according to the values of a grouping column. Provides each data partition as a data.frame in the first argument of f. Supports parallel execution of each f invocation in the pool of database server-side R engines.

ore.rowApply

rqRowEval

Executes f by passing a specified number of rows (a chunk) of the provided input ore.frame. Provides each chunk as a data.frame in the first argument of f. Supports parallel execution of each f invocation in the pool of database server-side R engines.

ore.indexApply

No equivalent.

Executes f with no automatic transfer of data but provides the index of the invocation, 1 through n, where n is the number of times to invoke the function. Supports parallel execution of each f invocation in the pool of R engines running on the database server.

ore.grant rqGrant Grants read privilege access to a datastore or script.
ore.revoke rqRevoke Revokes read privilege access to a datastore or script.

ore.scriptCreate

sys.rqScriptCreate

Adds the provided R function into the Oracle R Enterprise R script repository with the provided name.

ore.scriptDrop

sys.rqScriptDrop

Removes the named R function from the Oracle R Enterprise R script repository.

ore.scriptList ALL_RQ_SCRIPTS

USER_RQ_SCRIPTS

Lists information about scripts.
ore.scriptLoad No equivalent. Loads the R function of a script into the R environment.