# RCall.jl - how to handle R package dependencies?

**URL:** <https://discourse.julialang.org/t/rcall-jl-how-to-handle-r-package-dependencies/83172>\
**Category:** Package Management\
**Tags:** question, interoperability, rcall\
**Created:** [June 22, 2022, 9:33am UTC](https://discourse.julialang.org/t/rcall-jl-how-to-handle-r-package-dependencies/83172 "2022-06-22T09:33:30Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [March 27, 2025, 9:27am UTC](https://discourse.julialang.org/t/rcall-jl-how-to-handle-r-package-dependencies/83172/3 "2025-03-27T09:27:59Z")

</div>

There is now RSetup.jl, but apparently not yet registered (and I’m not sure where it is!):

> [@\[ANN\] RSetup.jl: mini-R package manager for use with RCall](https://discourse.julialang.org/t/ann-rsetup-jl-mini-r-package-manager-for-use-with-rcall/127396):
>
> using RSetup setup\_r\_environment(["classInt"]) This single-function package will detect if the R environment includes the classInt library (or your choice of libraries) and, if needed, install it so that it is available for use with RCall. It’s on github at [Install RSetup.jl from github](https://github.com/technocrat/RSetup.jl) Not tested on Windows.

> [@pat-alt](#):
>
> **Q1: Is there an elegant/preferred way to install R package dependencies on load?**
> 
> [..]
> 
> **Q2: Is relying on deps of other languages utter madness or feasible?**

@technocrat, before this single function package is registered, maybe its function should just be added to RCall.jl? On Q2, in general I think it’s not madness (calling C code, or even better e.g. Rust, see [GitHub - Taaitaaiger/jlrs: Julia bindings for Rust](https://github.com/Taaitaaiger/jlrs) or calling to or from Python using PythonCall.jl), but for R, it’s not feasible if you want to distribute your programs without copyleft/GPL (that’s ok for many science/non-commercial stats users though):

> [@Creating app with PackageCompiler.jl --\> how to include R dependency?](https://discourse.julialang.org/t/creating-app-with-packagecompiler-jl-how-to-include-r-dependency/103167/7):
>
> I didn’t think RCall downloaded Julia for you, but I was mistaken, it does if you set R\_HOME = “\*”, using Conda. I’m not sure, that might still be at installation time, but since possible, could at least potentially be a runtime check. About R packages themselves, I think they are usually downloaded as source and compiled, and arguably could also be done at runtime (Julia could have C++\_compiler\_JLL…, maybe does already, to provide all needed infrastructure, it’s just would you want to wait fo…

---

_[View the full topic](https://discourse.julialang.org/t/rcall-jl-how-to-handle-r-package-dependencies/83172)._
