Installing R in Julia

Hi, im trying to install the package RCall but I’m running in some problem.

for context:

>R RHOME
/usr/local/lib/R

>R --version
R version 3.6.3 (2020-02-29) – “Holding the Windsock”

OS: Linux Mint 19

Now, when I do

Pkg.add(“RCall”)

Have no problem, but when I call it with

using RCall

I get the next error

[ Info: Precompiling RCall [6f49c342-dc21-5d91-9882-a32aef131414]
ERROR: LoadError: RCall not properly installed. Please run Pkg.build(“RCall”)
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] top-level scope at /home/username/.julia/packages/RCall/g7dhB/src/RCall.jl:36
[3] include at ./boot.jl:317 [inlined]
[4] include_relative(::Module, ::String) at ./loading.jl:1044
[5] include(::Module, ::String) at ./sysimg.jl:29
[6] top-level scope at none:2
[7] eval at ./boot.jl:319 [inlined]
[8] eval(::Expr) at ./client.jl:393
[9] top-level scope at ./none:3
in expression starting at /home/username/.julia/packages/RCall/g7dhB/src/RCall.jl:33

and when I run

Pkg.build(“RCall”)

I get the next error

Conda → ~/.julia/packages/Conda/3rPhK/deps/build.log
Building RCall → ~/.julia/packages/RCall/g7dhB/deps/build.log
┌ Error: Error building RCall:
│ ERROR: LoadError: R cannot be found. Set the “R_HOME” environment variable to re-run Pkg.build(“RCall”).
│ Stacktrace:
│ [1] error(::String) at ./error.jl:33
│ [2] top-level scope at /home/username/.julia/packages/RCall/g7dhB/deps/build.jl:49
│ [3] include at ./boot.jl:317 [inlined]
│ [4] include_relative(::Module, ::String) at ./loading.jl:1044
│ [5] include(::Module, ::String) at ./sysimg.jl:29
│ [6] include(::String) at ./client.jl:392
│ [7] top-level scope at none:0
│ in expression starting at /home/username/.julia/packages/RCall/g7dhB/deps/build.jl:10
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1096

I try to set the R_HOME variable to be the same as >R RHOME with

ENV[“R_HOME”] = “/usr/local/lib/R/”

But that give me same error when running Pkg.built(“RCall”).

Thanks for any help!

hmm, i wonder if setting R_HOME via bash export would work like

export R_HOME= "/usr/local/lib/R/"

and then start Julia again and run