JuliaInterop / JuliaCall

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

Error: attempt to apply non-function #215

Open schlichtanders opened 11 months ago

schlichtanders commented 11 months ago

For some julia values, the call method is not supported on R side

PlutoUI = julia_eval("using PlutoUI; PlutoUI")
PlutoUI$Slider(c(1,2,3))

returns

REvalError: Error: attempt to apply non-function

    var"#handle_eval_stderr#31"(::Bool, ::typeof(RCall.handle_eval_stderr))@io.jl:174
    handle_eval_stderr@io.jl:168[inlined]
    reval_p(::Ptr{LangSxp}, ::Ptr{EnvSxp})@eval.jl:103
    reval_p(::Ptr{RCall.ExprSxp}, ::Ptr{EnvSxp})@eval.jl:119
    reval(::String, ::RObject{EnvSxp})@eval.jl:136
    reval(::String)@eval.jl:136
    macro expansion@[Local: 299](...)[inlined]
    top-level scope@[Local: 1](...)[inlined]

It would be great if the R call syntax works also here to run the julia call.

This is most frequent problem I have with JuliaCall

Workaround

julia_call("PlutoUI.Slider", c(1,2,3))
schlichtanders commented 11 months ago

Another example:

HTML <- julia_eval("HTML")
HTML("<h1> title </h1>")

gives an error

could not find function "HTML"

despite it is callable on julia side