Description Usage Arguments Value See Also Examples
Send R object x
to julia, i.e., translate it to a corresponding julia
object, and store that as y
.
1 2 |
x |
an R object. Currently must fulfill certain properties to be translatable to Julia. |
y |
a |
on success, NULL
, invisibly.
j2r
aka julia_eval
for the reverse of this.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## assign R's pi to Julia, as "Rpi"
r2j(pi, "Rpi")
j2r("pi") # Julia's builtin pi
## is there a difference
j2r("Rpi - pi") # typically 0
## integer vector:
r2j(1:10, "i10")
j2r("i10") ; stopifnot(identical(1:10, j2r("i10")))
## matrix, passed to Julia and got back
m <- matrix(exp(-5:6), 3,4)
r2j(m, "m")
stopifnot(identical(m, j2r("m")))
## complex -- not yet _FIXME_
z <- complex(modulus = 4, argument = pi*(0:16)/8)
r2j(z, "z") # does *not* work ! but gives no error
if(FALSE)
stopifnot(identical(z, j2r("z")))
try( j2r( "z" ) )# -> "... undefined"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.