RCall.jl icon indicating copy to clipboard operation
RCall.jl copied to clipboard

ERROR: invalid redefinition of constant with R library

Open gaballench opened this issue 3 years ago • 0 comments

Hello!

I am trying to load the r package ape from within julia using RCall.

It fails when trying to load it with the @rlibrary macro:

julia> @rlibrary ape
ERROR: invalid redefinition of constant node_depth_edgelength
Stacktrace:
 [1] top-level scope
   @ none:1
 [2] eval
   @ ./boot.jl:360 [inlined]
 [3] rimport(pkg::String, s::Symbol; normalizenames::Bool)
   @ RCall ~/.julia/packages/RCall/3mHXJ/src/namespaces.jl:41
 [4] rimport
   @ ~/.julia/packages/RCall/3mHXJ/src/namespaces.jl:22 [inlined]
 [5] rimport (repeats 2 times)
   @ ~/.julia/packages/RCall/3mHXJ/src/namespaces.jl:46 [inlined]
 [6] top-level scope
   @ ~/.julia/packages/RCall/3mHXJ/src/namespaces.jl:95

however, it works when calling library inside an R string (i.e., using R""):

julia> R"library(ape)"
RObject{StrSxp}
[1] "ape"       "stats"     "graphics"  "grDevices" "utils"     "datasets" 
[7] "methods"   "base"     

My guess is that something happens when loading ape's namespace but I don't understand why the macro fails while the R string does not. I have been unable to find a similar case in earlier issues.

Thanks in advance,

Gustavo

gaballench avatar May 24 '21 19:05 gaballench