Description Usage Arguments Details Value See Also Examples
calljulia
lets you run julia code from R.
1 2 |
julia.code |
a string of julia code to be run. The names of variables
used in this string should match those in the |
inputs |
List containing all variables that need to be passed to julia.
The names of the elements of the list should match the names used in
|
output.names |
Array of names of all variables that should be returned from julia. The names should match those used in julia.code. All variables must be numeric (no strings). |
delete.temp |
Default |
norun |
Default |
julia.call |
How julia can be invoked through the |
This function writes the inputs to temporary files (which are deleted unless
delete.temp
is set to FALSE
). Next, a file of julia code is
produced (named doit.jl
and saved in the working directory). Next,
this julia code is run by invoking julia from the command line. Finally, the
outputs are saved to file and read back into R.
Returns the following:
outputs
List containing all variables that were listed in
output.names
with the values they have after julia.code
was
executed in Julia
command
the string that is run on the command line.
callconvex
callconvex.varyparams
1 2 3 4 5 6 7 8 9 10 | ## Not run:
set.seed(1)
x <- matrix(rnorm(1000), 20, 50)
# change this next line based on where julia is located:
julia <- "/Applications/Julia-0.3.3.app/Contents/Resources/julia/bin/julia"
jl <- calljulia("y = x + a; z = y - 2", inputs=list(x = x, a = 10),
output.names=c("y", "z"), julia.call = julia)
range(jl$y - x)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.