Search code examples
juliarcall

How to install an R package using RCall.jl


I am using RCall.jl in Julia and am getting errors because the code I want to run is relying on some R packages which I have yet to install. Is there a way (like with PyCall.jl and Conda.jl) that I can install the required R package though the RCall.jl Julia interface?


Solution

  • All you need to do is:

    using RCall
    

    and then type the $ in the REPL, followed by:

    R> install.packages("name_of_R_package_you_want")
    --- Please select a CRAN mirror for use in this session ---
    Secure CRAN mirrors