juliaEval: Evaluate a Julia expression

View source: R/main.R

juliaEvalR Documentation

Evaluate a Julia expression

Description

This function evaluates Julia code, given as a string, in Julia, and translates the result back to R.

Usage

juliaEval(expr)

Arguments

expr

Julia code, given as a one-element character vector

Details

If the code needs to use R variables, consider using juliaLet instead.

Value

The value returned from Julia, translated to an R data structure. If Julia returns nothing, an invisible NULL is returned. This is also the case if the last non-whitespace character of expr is a semicolon.

Examples

if (juliaSetupOk()) {
   juliaEval("1 + 2")
   juliaEval('using Random; Random.seed!(5);')

## Not run: 
   juliaEval('using Pkg; Pkg.add("BoltzmannMachines")')

## End(Not run)
}


JuliaConnectoR documentation built on Oct. 9, 2024, 1:08 a.m.