Tell julia where R is

I run Julia in Jupyter on AWS Amazon SageMaker, where it is installed using anaconda. R Jupyter notebooks work as well, so clearly R is installed. “add RCall” in Julia’s package manager succeeds. But when I do “using RCall” in julia, I get

ERROR: LoadError: RCall not properly installed. Please run Pkg.build(“RCall”)

When I run Pkg.build(“RCall”) in Julia, I get

ERROR: LoadError: Could not find library /usr/local/lib64/R/lib/libR.so. Make sure that R shared library exists.

Because of anaconda, R is installed in a different environment than Julia. How do I tell Julia where R is? I tried installing R from source, but that turns out to be quite tricky; and it really should be unnecessary, as R already runs perfectly well in its own anaconda environment. If I do conda info --envs I get, among others, R and JupyterSystemEnv.

Does this help?
https://juliainterop.github.io/RCall.jl/stable/installation/
It recommends setting:

ENV["R_HOME"] = "....directory of R home...."
Pkg.build("RCall")
1 Like

That was it! Awesome! Thanks!!