JuliaInterop / JuliaCall

Embed Julia in R
https://non-contradiction.github.io/JuliaCall/index.html
Other
267 stars 36 forks source link

Recovering a complex julia structure #230

Open jfmoyen opened 4 months ago

jfmoyen commented 4 months ago

Good day,

Thanks and congrats for the nice work! I have a (possibly very simple) problem: I'm using a julia package, MAGEMin_c (https://github.com/ComputationalThermodynamics/MAGEMin_C.jl ) that outputs a rather complex structure described here: https://computationalthermodynamics.github.io/MAGEMin/ckbk/out_struct.html#as-a-nested-structure

From R, the only way I managhed to recover it is piecewise, by calling individually e.g. julia_eval("out1.ph"), julia_eval("out1.SS_vec[2].Comp_wt"), etc.

This is rather clumsy, and it seems to me that the julia object should be equivalent to a R list ? Still, trying to do julia_eval("out1") only gives me Julia Object of type MAGEMin_C.gmin_struct{Float64, Int64}. (etc)

Am I missing an easier way ?

Thanks !