juliaGet: Translate a Julia proxy object to an R object

View source: R/main.R

juliaGetR Documentation

Translate a Julia proxy object to an R object

Description

R objects of class JuliaProxy are references to Julia objects in the Julia session. These R objects are also called "proxy objects". With this function it is possible to translate these objects into R objects.

Usage

juliaGet(x)

Arguments

x

a reference to a Julia object

Details

If the corresponding Julia objects do not contain external references, translated objects can also saved in R and safely be restored in Julia.

Modifying objects is possible and changes in R will be translated back to Julia.

The following table shows the translation of Julia objects into R objects.

Julia R
struct \rightarrow list with the named struct elements
Array of struct type \rightarrow list (of lists)
Tuple \rightarrow list
NamedTuple \rightarrow list with the named elements
AbstractDict \rightarrow list with two sub-lists: "keys" and "values"
AbstractSet \rightarrow list

Note

Objects containing circular references cannot be translated back to Julia.

It is safe to translate objects that contain external references from Julia to R. The pointers will be copied as values and the finalization of the translated Julia objects is prevented. The original objects are garbage collected after all direct or indirect copies are garbage collected. Note, however, that these translated objects cannot be translated back to Julia after the Julia process has been stopped and restarted.


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