julia_eval: Evaluate Julia Code or Get a Julia Variable

Description Usage Arguments Value See Also Examples

Description

Evaluate Julia code from R, or simply get a Julia variable into R.

Whereas j2r() is currently identical to julia_eval(), julia_void_eval() will evaluate code in the running julia process without returning a value.

Usage

1
2
3
4
5
j2r        (expression) # short for
julia_eval (expression)

jDo            (expression) # short for
julia_void_eval(expression)

Arguments

expression

a character string.

Value

an R object, translated from the corresponding Julia object to which expression evaluated.

See Also

r2j() to “send” R objects to Julia.

Examples

1
2
3
4
5
j2r("cos(pi * (1:7))")

j2r("map(x -> x^2, (7,17,47))") # tuple in Julia ==>  list (with no names!) in R

j2r("rand(2,3)")# or rather use R's RNG

armgong/rjulia documentation built on May 10, 2019, 1:41 p.m.