Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

On top of what else has been said: you can call R from within Julia with almost negligible overhead via RCall.jl[0], so you can still use code you have already written.

https://github.com/JuliaInterop/RCall.jl



sort by: page size:

You can use RCall to use R from Julia: https://github.com/JuliaInterop/RCall.jl

I'd love to switch to Julia, but I rely on a lot of packages that are only available in R (e.g. lots from http://bioconductor.org/). Is there any way to call R code from Julia?

I don't use it personally, but RCall.jl[1] is the main R interop package in Julia. You could call libraries that have no equivalent in Julia using that and write your own analyses in Julia instead.

[1] https://github.com/JuliaInterop/RCall.jl


> Can you call R from Julia yet?

Yes. There's even an R REPL mode.

https://github.com/JuliaInterop/RCall.jl


I think RJulia goes the other way; calling Julia from R.

You want RCall.jl and PyCall.jl. Both allow you to directly work with and manipulate native objects. RCall even allows you to bring up an R REPL.


The same with R. There's already the excellent JuliaCall[1] package, for embedding Julia code in R. Listed in the README are some R packages, using Julia code through JuliaCall.

[1] https://github.com/Non-Contradiction/JuliaCall


> nice foreign function interface between R->Julia and Julia ->R

JuliaCall[1] and RCall[2].

Python<->Julia is similarly well exercised with PyCall[1], and recently PythonCall[2].

[1] https://non-contradiction.github.io/JuliaCall/index.html [2] https://github.com/JuliaInterop/RCall.jl [3] https://github.com/JuliaPy/PyCall.jl [4] https://cjdoris.github.io/PythonCall.jl/stable/


I think the best route is to create shared libraries using Julia and call them from R.

I didn't know this. Will look into it, thanks!

edit: looked up "call R from Julia", it looks like there's a n "RJulia" library for this. Assuming there's a Python equivalent? How does this compare to, say, using RPy2 in Python (which is nice but kind of annoying)?


There's a package for using R libraries (https://juliainterop.github.io/RCall.jl/stable/) and one for Python libraries (https://github.com/JuliaPy/PyCall.jl). It's pretty seamless.

Interesting. Sensible. How possible/easy is it to use Julia libraries from e.g. python or R or C++?

I often ask myself the question, how can Julia do things that R cannot do. After all, when something is good at doing something, why replace it?

Part of this is why we did JuliaDB: http://juliadb.org/ and continue to try push the boundaries on parallelism, missing data, OnlineStats.jl and making data manipulation and modeling that much easier.


Use this if there isn't a Julia library available: https://github.com/JuliaPy/PyCall.jl

> The thing that keeps me coming back to Julia is the ability to pipe

> Provides link to R.

Is there an example of this in Julia? I use R now, and every time I give Julia a shot I go back to R because of the insane TTFP. I don't use anything remotely close to big data, and the 90-120s compile times just to replot my small data (using AlgebraOfGraphics.jl in a Pluto notebook) just kill me.


Luckily, you can call many Python libraries directly from your Julia code: https://github.com/JuliaPy/PyCall.jl

>the dependency on using the REPL

This is a feature for a lot of Julia's core audience (data scientists like me, who grew up with R).


Embedding Julia is not hard. ( "calling Julia function from C code" )

https://docs.julialang.org/en/v1/manual/embedding/


No, nlopt. Why we could easy port from R to Julia as nlopt exists for both (its c)

Obviously that question depends on your motivation, but one good reason is that it is a great way to learn how software actually works.

R makes it very easy to see the underlying R code (you just type the function name), until you get to a ".Call" or ".Primitive": from that point, it is effectively a black box.

But as most of Julia is written in Julia, you can easily inspect and understand how functions work, all the way down. Moreover, by using the @code_* macros, you can also inspect the various stages by which the code is transformed from high level Julia code down to the actual machine code which is running on your computer.

next

Legal | privacy