JuliaFunction-class {XRJulia} | R Documentation |
Proxy Objects in R for Julia Functions
Description
A class and generator function for proxies in R for Julia functions.
Usage
JuliaFunction(...)
## S4 method for signature 'JuliaFunction'
initialize(name, module = "", evaluator =
RJulia(, ...))
Arguments
name , module |
The name and module of the Julia function. |
evaluator |
The evaluator object to use. By default, and usually, the current evaluator is used, and one is started if none has been. |
... |
For |
Details
An object from this class is an R function that is a proxy for a function in Julia. Calls to the R function evaluate a call to the Julia function. The arguments in the call are converted to equivalent Julia objects; these typically include proxy objects for results previously computed through the XRJulia interface.
Slots
name
the name of the server language function
module
the name of the module, if that needs to be imported
evaluatorClass
the class for the evaluator, by default and usually,
JuliaInterface
Examples
if(findJulia(test = TRUE) ) {
## even so, the Julia may not be valid
## so we catch any errors in the example, mainly to keep CRAN quiet
tryCatch( {set.seed(228)
x <- matrix(rnorm(1000),20,5)
xm <- juliaSend(x)
juliaCommand("using LinearAlgebra")
svdJ <- JuliaFunction("svd")
sxm <- svdJ(xm)
sxm
}, error = function(e) message("Julia Example error: " ,e$message))}