julia_eval: Evaluate string commands in julia and get the result back in...

julia_evalR Documentation

Evaluate string commands in julia and get the result back in R.

Description

julia_eval evaluates string commands in julia and returns the result to R. The returning julia object will be automatically converted to an R object or a JuliaObject wrapper, see the documentation of the argument 'need_return' for more details. 'julia_eval' will not invoke julia display system. If you don't need the returning result in R or you want to invoke the julia display system, you can use julia_command.

Usage

julia_eval(cmd, need_return = c("R", "Julia"))

Arguments

cmd

the command string you want to evaluate in julia.

need_return

whether you want julia to return value as an R object or a wrapper for julia object.

Value

the R object automatically converted from julia object.

Examples


if (identical(Sys.getenv("AUTO_JULIA_INSTALL"), "true")) { ## julia_setup is quite time consuming
  ## doing initialization and automatic installation of Julia if necessary
  julia_setup(installJulia = TRUE)
  julia_eval("sqrt(2)")
}


JuliaCall documentation built on Sept. 8, 2022, 5:10 p.m.