JuliaFunction-class | R Documentation |
A class and generator function for proxies in R for Julia functions.
JuliaFunction(...)
## S4 method for signature 'JuliaFunction'
initialize(name, module = "", evaluator =
RJulia(, ...))
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 |
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.
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
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))}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.